Skip to content

Commit 834c03a

Browse files
authored
Merge pull request #112 from mohd-raza/pull-error
Pull Error with Solution
2 parents f5c3154 + ae6bd42 commit 834c03a

File tree

2 files changed

+63
-34
lines changed

2 files changed

+63
-34
lines changed
Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,85 @@
1-
import React, { useState, useEffect } from 'react';
1+
import React, { useState, useEffect } from "react";
22
// import Data from '../../data/Contributors.json';
3-
import Layout from '../../components/Layout/Layout';
4-
import './css/index.css';
3+
import Layout from "../../components/Layout/Layout";
4+
import "./css/index.css";
55

66
function Contribute() {
77
const userURL = "https://api.github.com/users/";
8-
const url = "https://api.github.com/repos/devvsakib/github-error-solve/contributors"
8+
const url =
9+
"https://api.github.com/repos/devvsakib/github-error-solve/contributors";
910
const [data, setData] = useState([]);
1011
const [loading, setLoading] = useState(true);
1112
useEffect(() => {
12-
setLoading(false)
13+
setLoading(false);
1314
const fetchUsers = async (url) => {
1415
const response = await fetch(url);
1516
const users = await response.json();
16-
setData(users)
17-
setLoading(true)
18-
}
19-
fetchUsers(url)
20-
}, [data.length])
17+
setData(users);
18+
setLoading(true);
19+
};
20+
fetchUsers(url);
21+
}, [data.length]);
2122

2223
// fun purpose, but looks better, isn't it?
2324
const changeColor = () => {
24-
const colorArray = ["4024e0", "1a5ba5", "118d7c", "8d54e1", "40E4F0", "7e1aa5"]
25+
const colorArray = [
26+
"4024e0",
27+
"1a5ba5",
28+
"118d7c",
29+
"8d54e1",
30+
"40E4F0",
31+
"7e1aa5",
32+
];
2533
let element;
2634

27-
return element = colorArray[Math.floor(Math.random() * 6)];
28-
}
35+
return (element = colorArray[Math.floor(Math.random() * 6)]);
36+
};
2937
return (
3038
<Layout>
31-
<section className='flex flex-wrap justify-center'>
39+
<section className="flex flex-wrap justify-center">
3240
{
3341
// User filtered by CONTRIBUTIONS number, contribute more to jump in first place
3442

35-
loading ? (data.map(user =>
36-
<div
37-
id="container"
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`}>
39-
<h1>{user.login} <small className='text-violet-400 container:hover:text-white'>{user.contributions}</small></h1>
40-
<img className='pfp' src={user.avatar_url} />
41-
<div className="links">
42-
<a className='spf-link' href={user.html_url}>Github</a>
43-
<a className='spf-link' href={user.twiter}>Twiter</a>
44-
{/* spf-link : abbreviation of (specific-link) for css */}
43+
loading ? (
44+
data.map((user) => (
45+
<div
46+
id="container"
47+
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`}
48+
>
49+
<h1>
50+
{user.login}{" "}
51+
<small className="text-violet-400 container:hover:text-white">
52+
{user.contributions}
53+
</small>
54+
</h1>
55+
<img className="pfp" src={user.avatar_url} />
56+
<div className="links">
57+
<a className="spf-link" href={user.html_url}>
58+
Github
59+
</a>
60+
<a className="spf-link" href={user.twiter}>
61+
Twiter
62+
</a>
63+
{/* spf-link : abbreviation of (specific-link) for css */}
64+
</div>
4565
</div>
46-
</div>
47-
)
66+
))
4867
) : (
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>
68+
<div className="translate-y-[4rem]">
69+
<img
70+
src="/assets/run.gif"
71+
className="w-1/2 mx-auto"
72+
alt="Running Gif"
73+
/>
74+
<h1 className="text-center md:text-2xl text-white">
75+
Contributors coming...
76+
</h1>
5477
</div>
5578
)
5679
}
5780
</section>
5881
</Layout>
59-
)
82+
);
6083
}
6184

62-
export default Contribute
85+
export default Contribute;

src/data/error.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@
137137
"title": "ssl certificate problem unable to get local issuer certificate",
138138
"description": "It is a common git error encountered by users when attempting to push, pull, or clone a git repository with Git Bash, a Windows-specific command-line tool.",
139139
"solutions": "{'git -c http.sslVerify=false clone [URL]':'Command to disable SSL certificate validation in git locally. For security considerations, it is not advised to disable SSL certificate validation. However, it is a possible solution to this issue.'}"
140+
},
141+
{
142+
"type": "pull",
143+
"title": "error: failed to push some refs to 'https://github.com/…'",
144+
"description": "This error occurs when you try to push to a repository but your local branch is behind the remote branch and you need to pull the changes first.",
145+
"solutions": "git fetch origin <git status <git merge origin/REMOTE-BRANCHNAME <\"local and remote changes needs to be resolved before pushing your changes.\" <git push origin BRANCHNAME"
140146
}
141147
]
142-
}
148+
}

0 commit comments

Comments
 (0)