Files
freeCodeCamp/common/app/routes/Jobs/components/Show.jsx

54 lines
1.1 KiB
React
Raw Normal View History

2015-07-25 21:32:18 -07:00
import React, { PropTypes } from 'react';
import { contain } from 'thundercats-react';
import { Accordion, Thumbnail, Panel } from 'react-bootstrap';
export default contain(
{
},
React.createClass({
displayName: 'ShowJobs',
propTypes: {
jobs: PropTypes.array
},
renderJobs(jobs =[]) {
return jobs.map((
2015-07-25 21:59:52 -07:00
{ id, company, position, description, logo },
2015-07-25 21:32:18 -07:00
index
) => {
const header = (
<div>
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
<h5
className='pull-right'
style={{ display: 'inline-block' }}>
{ position }
</h5>
</div>
);
return (
<Panel
collapsable={ true }
eventKey={ index }
header={ header }
key={ id }>
2015-07-25 21:59:52 -07:00
<Thumbnail alt='171x180' src={ logo } />
2015-07-25 21:32:18 -07:00
<p>{ description }</p>
2015-07-25 21:59:52 -07:00
2015-07-25 21:32:18 -07:00
</Panel>
);
});
},
render() {
const { jobs } = this.props;
return (
<Accordion>
{ this.renderJobs(jobs) }
</Accordion>
);
}
})
);