Skip to content

Commit 1375c0c

Browse files
authored
Merge pull request #106 from devvsakib/development
loading added
2 parents 1d8496c + 7d84254 commit 1375c0c

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

public/assets/bird.gif

493 KB
Loading

public/assets/man.gif

145 KB
Loading

public/assets/run.gif

24.3 KB
Loading

src/components/Contributors/contributors.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)