Skip to content
This repository was archived by the owner on Jun 14, 2020. It is now read-only.

Commit a1d13b4

Browse files
authored
Merge pull request #158 from ghuser-io/ui
Improve Profile Pages
2 parents 94048f4 + 35f0bde commit a1d13b4

38 files changed

Lines changed: 1252 additions & 469 deletions

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ We love the default GitHub profiles and we want to enhance them:
4949
GitHub. We are showing them **all**, even those you don't own and those owned by organizations
5050
you're not in.<sup>[1](#footnote1)</sup>
5151
* The GitHub profiles are listing all the repos you own but they sort them only by age of the
52-
latest commit. We prefer to **sort repos** by a combination of how active they are, how much you
53-
have contributed to them, how popular they are, etc. For each user we want to see first the latest
54-
greatest repos they have most contributed to.
55-
* On GitHub only repos earn stars. We push it one step further by transferring these **stars to
56-
users**. If you have built 23% of a 145 stars repo, you deserve 33 stars for that contribution. We
57-
add all these stars and clearly show how many of them you earned in total.
52+
latest commit. We prefer to **sort repos** by a combination of how much you
53+
have contributed to them, their size, how popular they are, etc. For each user we want to see
54+
first the latest greatest repos they have most contributed to.
55+
* On GitHub only repos earn stars. We push it one step further by having **users earn stars**:
56+
You earn stars when you contribute to a repo.
57+
We add all these earned stars and show how many you've earned in total.
5858
* The GitHub profiles don't clearly show how big your contribution to a repo was, when you don't own
5959
it. Maybe you wrote 5%. Maybe 90%. We **make it clear**.
6060
* GitHub detects programming languages. We want to also know about

docs/repo-settings.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ See [this example](../.ghuser.io.json).
3333
```json
3434
{
3535
"_comment": "Repo metadata for ghuser.io. See https://github.com/ghuser-io/ghuser.io/blob/master/docs/repo-settings.md",
36-
"techs": ["React", "Node.js", "Reframe", "Bootstrap", "Semantic UI", "AWS"]
36+
"techs": ["React", "Node.js", "Reframe", "hapi", "Bootstrap", "Semantic UI", "AWS", "Ansible",
37+
"Travis CI"]
3738
}
3839
```
3940

docs/repo-settings.png

2.66 KB
Loading

docs/screenshot-data-age.png

-1.85 KB
Loading

docs/screenshot.png

17.3 KB
Loading

reframe/views/All.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ a:hover
4949
display: inline-block;
5050
color: #bcc0c4;
5151
}
52+
/* avoid external link icon above to be shown in a new line */
53+
.external {
54+
white-space: nowrap;
55+
}
5256

5357
.container-lg {
5458
max-width: 1012px;
@@ -64,3 +68,22 @@ a:hover
6468
.text-bold {
6569
font-weight: 600;
6670
}
71+
72+
body {
73+
padding-bottom: 90px;
74+
}
75+
76+
.emoji {
77+
height: 1.3em;
78+
width: auto;
79+
}
80+
81+
.icon-vertical-align {
82+
vertical-align: middle !important;
83+
}
84+
85+
/* TODO remove this */
86+
/* this is too global */
87+
.icon {
88+
vertical-align: middle !important;
89+
}

reframe/views/profile/Avatar.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
.avatar {
22
max-width: 100%;
33
height: auto;
4+
display: inline-flex;
5+
align-items: center;
6+
justify-content: center;
47
}
58

9+
.avatar-small {
10+
float: left;
11+
width: 50px;
12+
height: 50px;
13+
margin-right: .5em;
14+
margin-bottom: -.5em;
15+
}
16+
17+
.avatar-add {
18+
border-width: medium !important;
19+
text-align: center;
20+
opacity: 0.55;
21+
transition: opacity 0.5s;
22+
}
23+
.avatar-add:hover {
24+
opacity: 1;
25+
}
626
.avatar-add-sign {
27+
display: inline-block;
728
vertical-align: middle;
29+
background-color: #eee;
30+
width: 24px;
31+
margin-top: -5px;
832
}

reframe/views/profile/Avatar.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@ import React from 'react';
22

33
import './Avatar.css';
44

5-
const Avatar = props => {
6-
if (props.type == "add") { // special button for explaining how to add an avatar
7-
return <div className={`avatar border border-white rounded ${props.classes}`}>
8-
<span className="avatar-add-sign">+</span>
9-
</div>;
10-
}
11-
return <img className={`avatar border border-white rounded ${props.classes}`} src={props.url} />;
12-
};
5+
const Avatar = ({classes, url}) => (
6+
<img className={`avatar border border-white rounded ${classes}`} src={url} />
7+
);
138

149
export default Avatar;

reframe/views/profile/AvatarAdd.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
3+
export default AvatarAdd;
4+
5+
function AvatarAdd() {
6+
return (
7+
<div className="avatar border border-white rounded avatar-small avatar-add">
8+
<span className="avatar-add-sign text-gray">+</span>
9+
</div>
10+
);
11+
}

reframe/views/profile/leftpanel/LeftPanel.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@ import VCardDetails from './VCardDetails';
88
import './LeftPanel.css';
99
import Avatar from '../Avatar';
1010
import {urls} from '../../../ghuser';
11+
import {getTotalEarnedStars} from './../rightpanel/contrib/badges/Badges';
1112

1213
const LeftPanel = props => {
13-
let stars = 0;
14-
for (const repo in props.contribs && props.contribs.repos) {
15-
const contrib = props.contribs.repos[repo];
16-
stars += contrib.percentage * contrib.stargazers_count / 100;
17-
}
14+
const totalEarnedStars = getTotalEarnedStars(props.contribs);
1815

1916
return (
2017
<div className="col-3 p-0 pr-4">
2118
<Avatar url={props.user.avatar_url || AvatarUnknown} classes="avatar-user" />
2219
<VCard login={props.user.login}
2320
name={!props.user.ghuser_created_at && 'Your name here' || props.user.name}
24-
url={props.user.html_url} stars={stars} />
21+
url={props.user.html_url} stars={totalEarnedStars} />
2522
<Bio text={
2623
props.user.ghuser_being_created && "This profile is being created..." ||
2724
!props.user.ghuser_created_at && "I love coding and I'm about to create my profile on ghuser.io :)" ||

0 commit comments

Comments
 (0)