forked from jscomplete/learn-fullstack-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContestPreview.js
More file actions
28 lines (25 loc) · 708 Bytes
/
Copy pathContestPreview.js
File metadata and controls
28 lines (25 loc) · 708 Bytes
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
import React, { Component } from 'react';
class ContestPreview extends Component {
handleClick = () => {
this.props.onClick(this.props._id);
};
render() {
return (
<div className="link ContestPreview" onClick={this.handleClick}>
<div className="category-name">
{this.props.categoryName}
</div>
<div className="contest-name">
{this.props.contestName}
</div>
</div>
);
}
}
ContestPreview.propTypes = {
_id: React.PropTypes.string.isRequired,
categoryName: React.PropTypes.string.isRequired,
contestName: React.PropTypes.string.isRequired,
onClick: React.PropTypes.func.isRequired,
};
export default ContestPreview;