2015-07-25 21:32:18 -07:00
|
|
|
import React, { cloneElement, PropTypes } from 'react';
|
2015-07-25 15:15:59 -07:00
|
|
|
import { contain } from 'thundercats-react';
|
2015-07-25 21:32:18 -07:00
|
|
|
import { Button, Jumbotron, Row } from 'react-bootstrap';
|
2015-08-25 12:25:30 -07:00
|
|
|
import ListJobs from './List.jsx';
|
2015-06-17 21:04:28 -07:00
|
|
|
|
2015-07-25 13:58:26 -07:00
|
|
|
export default contain(
|
|
|
|
{
|
|
|
|
store: 'jobsStore',
|
2015-07-25 15:42:03 -07:00
|
|
|
fetchAction: 'jobActions.getJobs'
|
2015-07-25 13:58:26 -07:00
|
|
|
},
|
|
|
|
React.createClass({
|
|
|
|
displayName: 'Jobs',
|
|
|
|
propTypes: {
|
2015-07-25 21:32:18 -07:00
|
|
|
children: PropTypes.element,
|
2015-07-25 13:58:26 -07:00
|
|
|
jobs: PropTypes.array
|
|
|
|
},
|
2015-06-17 21:04:28 -07:00
|
|
|
|
2015-08-25 12:25:30 -07:00
|
|
|
renderList(jobs) {
|
2015-07-25 21:32:18 -07:00
|
|
|
return (
|
2015-08-25 12:25:30 -07:00
|
|
|
<ListJobs jobs={ jobs }/>
|
2015-07-25 21:32:18 -07:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
renderChild(child, jobs) {
|
|
|
|
if (!child) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return cloneElement(
|
|
|
|
child,
|
|
|
|
{ jobs }
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
2015-07-25 13:58:26 -07:00
|
|
|
render() {
|
2015-07-25 21:32:18 -07:00
|
|
|
const { children, jobs } = this.props;
|
|
|
|
|
2015-07-25 13:58:26 -07:00
|
|
|
return (
|
2015-07-25 21:32:18 -07:00
|
|
|
<div>
|
2015-07-25 13:58:26 -07:00
|
|
|
<Row>
|
2015-07-25 21:32:18 -07:00
|
|
|
<Jumbotron>
|
|
|
|
<h1>Free Code Camps' Job Board</h1>
|
|
|
|
<p>
|
|
|
|
Need to find the best junior developers?
|
|
|
|
Want to find dedicated developers eager to join your company?
|
|
|
|
Sign up now to post your job!
|
|
|
|
</p>
|
|
|
|
<Button
|
|
|
|
bsSize='large'
|
|
|
|
className='signup-btn'>
|
|
|
|
Try the first month 20% off!
|
|
|
|
</Button>
|
|
|
|
</Jumbotron>
|
2015-07-25 13:58:26 -07:00
|
|
|
</Row>
|
2015-07-25 21:32:18 -07:00
|
|
|
<Row>
|
|
|
|
{ this.renderChild(children, jobs) ||
|
2015-08-25 12:25:30 -07:00
|
|
|
this.renderList(jobs) }
|
2015-07-25 21:32:18 -07:00
|
|
|
</Row>
|
|
|
|
</div>
|
2015-07-25 13:58:26 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|