Skip to content
This repository was archived by the owner on Oct 10, 2021. It is now read-only.

Commit 11ef787

Browse files
Merge pull request #11 from TechOUs/dev
Updated the UI and done some fixes
2 parents b66b089 + 4330698 commit 11ef787

File tree

9 files changed

+884
-96
lines changed

9 files changed

+884
-96
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Website for the users to search whether they have qualified for the hacktober fe
66
![GitHub package.json version](https://img.shields.io/github/package-json/v/TechOUs/HacktoberFest20)
77
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/TechOUs/HacktoberFest20)
88
![Lines of code](https://img.shields.io/tokei/lines/github/TechOUs/HacktoberFest20)
9-
![Website](https://img.shields.io/website?down_color=red&down_message=offline&up_color=blue&up_message=online&url=https%3A%2F%2Fhacktoberfest20.tech)
109

1110
![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/TechOUs/HacktoberFest20)
1211
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/TechOUs/HacktoberFest20)
@@ -17,6 +16,14 @@ Website for the users to search whether they have qualified for the hacktober fe
1716
![GitHub Repo stars](https://img.shields.io/github/stars/TechOUs/HacktoberFest20?style=social)
1817
![GitHub watchers](https://img.shields.io/github/watchers/TechOUs/HacktoberFest20?style=social)
1918

19+
Check this out at
20+
21+
[![Website](https://img.shields.io/website?down_color=red&down_message=offline&up_color=blue&up_message=www.hacktoberfest20.tech&url=http%3A%2F%2Fwww.hacktoberfest20.tech)](http://www.hacktoberfest20.tech)
22+
23+
or
24+
25+
[![Website](https://img.shields.io/website?down_color=red&down_message=offline&up_color=blue&up_message=https://hacktoberfest20.herokuapp.com&url=https%3A%2F%2Fhacktoberfest20.herokuapp.com)](https://hacktoberfest20.herokuapp.com)
26+
2027
## Code Of Conduct
2128

2229
We are following [**Contributor Covenant Code of Conduct**](.github/CODE_OF_CONDUCT.md).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react'
2+
3+
const PrStatusIcon = (props) => {
4+
5+
switch(props.prStatus){
6+
case 'right':
7+
return (
8+
<span style={{color: 'green',fontSize: '20px'}} title="Approved Pull Request">
9+
<i className="fas fa-check-circle"></i>
10+
</span>
11+
);
12+
case 'wrong':
13+
return (
14+
<span style={{color: 'red', fontSize: '20px'}} title="Rejected Pull Request">
15+
<i className="fas fa-times-circle"></i>
16+
</span>
17+
);
18+
default:
19+
return (
20+
<span style={{color: '#5b6987', fontSize: '20px'}} title="Pending Pull Request">
21+
<i className="fas fa-exclamation-circle"></i>
22+
</span>
23+
);
24+
}
25+
}
26+
27+
export default PrStatusIcon;

client/src/components/common/ProgressProfile.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ProgressProfile = (props) => {
44
const [statement, setStatement] = useState('No Data Found !');
55

66
useEffect(() => {
7-
switch (props.apiData.total_count) {
7+
switch (props.apiData.valid_count) {
88
case 0:
99
setStatement('Too far Away !');
1010
break;
@@ -21,29 +21,25 @@ const ProgressProfile = (props) => {
2121
setStatement('Goal Achieved !');
2222
break;
2323
default:
24-
if (props.apiData.total_count > 4) {
24+
if (props.apiData.valid_count > 4) {
2525
setStatement('Now You are Showing Off !');
2626
}
2727
break;
2828
}
29-
}, [props.apiData.total_count]);
29+
}, [props.apiData.valid_count]);
3030

3131
return (
3232
<div className="progressProfile">
3333
<div className="inlineProfile">
3434
<img
35-
src={
36-
props.apiData.total_count > 0
37-
? props.apiData.items[0].user.avatar_url
38-
: ''
39-
}
35+
src={props.apiData.items[0].user.avatar_url}
4036
alt="profile"
4137
/>
4238
<p>{props.apiData.items[0].user.login}</p>
4339
</div>
4440
<div className="inlineProfile">
4541
<p>
46-
<span>{props.apiData.total_count}</span> / 4
42+
<span>{props.apiData.valid_count}</span> / 4
4743
</p>
4844
<p>{statement}</p>
4945
</div>
+20-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import NoData from './NoData';
33
import PrIcon from './PrIcon';
4+
import PrStatusIcon from '../common/PrStatusIcon';
45

56
const RepoList = ({ apiData }) => {
67
const getRepoDate = (date) => {
@@ -10,27 +11,25 @@ const RepoList = ({ apiData }) => {
1011
.replace('GMT+0530 (India Standard Time)', '');
1112
};
1213

13-
if (apiData.total_count > 0) {
14-
return apiData.items.map((repo) => (
15-
<div key={repo.id} className="repoDiv">
16-
<h4>
17-
<PrIcon state={repo.state} />
18-
{repo.repository_url.replace(
19-
'https://api.github.com/repos/',
20-
''
21-
)}
22-
</h4>
23-
<p>{repo.title}</p>
24-
<p>
25-
<i className="far fa-clock"></i>
26-
{' '}
27-
{getRepoDate(repo.created_at)}
28-
</p>
29-
</div>
30-
));
31-
} else {
32-
return <NoData apiData={apiData} message="No Data Found !" />;
33-
}
14+
return apiData.items.map((repo) => (
15+
<div key={repo.id} className="repoDiv">
16+
<h4>
17+
<PrIcon state={repo.state} />
18+
{repo.repository_url.replace(
19+
'https://api.github.com/repos/',
20+
''
21+
)}
22+
</h4>
23+
<p>
24+
<PrStatusIcon prStatus={repo.prStatus} />
25+
{' '}
26+
{repo.title}
27+
</p>
28+
<p>
29+
<i className="far fa-clock"></i> {getRepoDate(repo.created_at)}
30+
</p>
31+
</div>
32+
));
3433
};
3534

3635
export default RepoList;

client/src/components/pages/Progress.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ const Progress = () => {
3333
}
3434

3535
const handleUserData = () => {
36-
if(apiData.status===200){
36+
if(apiData.status===200 && apiData.total_count>0){
3737
return (<ProgressData apiData={apiData}/>);
3838
}else{
39-
return (<NoData apiData={apiData}/>);
39+
return (<NoData apiData={apiData} message="No Data Found !"/>);
4040
}
4141
}
4242

client/src/components/styles/Footer.css

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@
3232
margin-bottom: 20px;
3333
}
3434

35+
/* for mi phone browsers */
36+
@media screen and (max-width: 377px){
37+
.techousFooter > div,
38+
.techousFooter > h2{
39+
width: 40%;
40+
}
41+
.techousLinks{
42+
margin-left: 30px;
43+
margin-right: 30px;
44+
margin-bottom: 50px;
45+
}
46+
}
3547

3648
@media screen and (min-width: 605px){
3749
.techousFooter{

client/src/components/styles/MainPage.css

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
margin-top: 40%;
4545
}
4646

47+
/* for mi phone browsers */
48+
@media screen and (max-width: 360px) and (max-height: 562px){
49+
#mainPage{
50+
padding-top: 15%;
51+
}
52+
}
53+
4754
@media screen and (max-width: 964px){
4855
#hacktoberFestLeft,
4956
#hacktoberFestRight{

client/src/components/styles/Progress.css

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
cursor: pointer;
3737
}
3838

39+
/* for mi phone browsers */
40+
@media screen and (max-width: 404px){
41+
.progressInputDiv > input{
42+
width: 65%;
43+
}
44+
}
45+
3946
@media screen and (min-width: 605px){
4047
#checkProgress > h1{
4148
margin-left: 9%;

0 commit comments

Comments
 (0)