File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed
src/components/Contributors Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ function Contribute() {
7
7
const userURL = "https://api.github.com/users/" ;
8
8
const url = "https://api.github.com/repos/devvsakib/github-error-solve/contributors"
9
9
const [ data , setData ] = useState ( [ ] ) ;
10
+ const [ loading , setLoading ] = useState ( true ) ;
10
11
useEffect ( ( ) => {
12
+ setLoading ( false )
11
13
const fetchUsers = async ( url ) => {
12
14
const response = await fetch ( url ) ;
13
15
const users = await response . json ( ) ;
14
16
setData ( users )
17
+ setLoading ( true )
15
18
}
16
19
fetchUsers ( url )
17
20
} , [ data . length ] )
@@ -29,7 +32,7 @@ function Contribute() {
29
32
{
30
33
// User filtered by CONTRIBUTIONS number, contribute more to jump in first place
31
34
32
- data . map ( user =>
35
+ loading ? ( data . map ( user =>
33
36
< div
34
37
id = "container"
35
38
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() {
42
45
</ div >
43
46
</ div >
44
47
)
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
+ )
45
56
}
46
57
</ section >
47
58
</ Layout >
You can’t perform that action at this time.
0 commit comments