-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProfileDataList.jsx
50 lines (47 loc) · 1.21 KB
/
ProfileDataList.jsx
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
/* eslint-disable react/forbid-prop-types,react/default-props-match-prop-types */
import React from 'react';
import PropTypes from 'prop-types';
const ProfileDataList = ({ data }) => {
if (data) {
return (
<ul className="list-group list-group-flush">
<li className="list-group-item"><h1>{data.name}</h1></li>
<li className="list-group-item">
{`Followers: ${data.followers}`}
</li>
<li className="list-group-item">
{`Following: ${data.following}`}
</li>
<li className="list-group-item">
{`Public repos: ${data.public_repos}`}
</li>
<li className="list-group-item">
{`Public Gists: ${data.public_gists}`}
</li>
<li className="list-group-item">
Blog:
<a href={data.blog}>{data.blog}</a>
</li>
<li className="list-group-item">
{`Location: ${data.location}`}
</li>
</ul>
);
}
return '';
};
ProfileDataList.defaultProps = {
data: {
name: '',
followers: 0,
following: 0,
public_repos: 0,
public_gists: 0,
blog: '',
location: '',
},
};
ProfileDataList.propTypes = {
data: PropTypes.object,
};
export default ProfileDataList;