-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathDeveloperCard.js
73 lines (70 loc) · 1.78 KB
/
DeveloperCard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react'
import { OutboundLink } from 'react-ga'
import GithubAvatar from '~/components/github-avatar/GithubAvatar'
const style = {
avatar: {
width: 64,
height: 64,
verticalAlign: 'middle',
marginRight: 16,
},
follows: {
fontWeight: '600'
},
action: {
display: 'inline-block',
textTransform: 'none',
},
fact: {
display: 'block'
},
cardNumber: {
display: 'block',
fontWeight: 'bold',
fontSize: '110%',
position: 'absolute',
right: 20,
top: 20
}
}
const DeveloperCard = ({user, index}) => (
<div className="card hoverable" title={user.description}>
<div className="card-content">
<span style={style.cardNumber}>#{index}</span>
<OutboundLink
className="card-title truncate"
target="_blank"
eventLabel={user.githubUrl}
to={user.githubUrl}
>
<p className="center-align">
<GithubAvatar
className="circle"
style={ style.avatar }
user={ user }
size="64"
/>
</p>
<p className="center-align">
{user.name || user.login}
</p>
</OutboundLink>
<p className="center-align">Followers <span style={ style.follows }>{user.followers}</span> | Following <span style={ style.follows }>{user.following}</span></p>
</div>
<div className="card-action">
<span style={style.fact}>{user.sources} repositories</span>
<span style={style.fact}>{user.forked} forks</span>
</div>
<div className="card-action truncate">
<OutboundLink
style={style.action}
target="_blank"
eventLabel={user.url || ''}
to={user.url}
>
{user.url}
</OutboundLink>
</div>
</div>
)
export default DeveloperCard