File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/components/CompareList Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
import { Container , Repository } from './styles' ;
3
4
4
5
const CompareList = ( { repositories } ) => (
5
6
< Container >
6
7
{ repositories . map ( repository => (
7
- < Repository >
8
+ < Repository key = { repository . id } >
8
9
< header >
9
10
< img src = { repository . owner . avatar_url } alt = { repository . owner . login } />
10
11
< strong > { repository . name } </ strong >
@@ -34,4 +35,21 @@ const CompareList = ({ repositories }) => (
34
35
</ Container >
35
36
) ;
36
37
38
+ CompareList . propTypes = {
39
+ repositories : PropTypes . arrayOf (
40
+ PropTypes . shape ( {
41
+ id : PropTypes . number ,
42
+ name : PropTypes . string ,
43
+ owner : PropTypes . shape ( {
44
+ login : PropTypes . string ,
45
+ avatar_url : PropTypes . string ,
46
+ } ) ,
47
+ stargazers_count : PropTypes . number ,
48
+ forks_count : PropTypes . number ,
49
+ open_issues_count : PropTypes . number ,
50
+ pushed_at : PropTypes . string ,
51
+ } ) ,
52
+ ) . isRequired ,
53
+ } ;
54
+
37
55
export default CompareList ;
You can’t perform that action at this time.
0 commit comments