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

60 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-08-25 14:36:07 -07:00
import React, { PropTypes } from 'react';
import { Thumbnail, Panel, Well } from 'react-bootstrap';
import moment from 'moment';
2015-08-26 11:13:58 -07:00
const thumbnailStyle = {
backgroundColor: 'white',
maxHeight: '100px',
maxWidth: '100px'
};
2015-08-25 14:36:07 -07:00
export default React.createClass({
displayName: 'ShowJob',
propTypes: {
job: PropTypes.object
},
renderHeader({ company, position }) {
return (
<div>
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
<h5
className='pull-right hidden-xs hidden-md'
style={{ display: 'inline-block' }}>
{ position }
</h5>
</div>
);
},
render() {
2015-08-26 11:13:58 -07:00
const { job } = this.props;
const {
logo,
position,
city,
state,
email,
phone,
postedOn,
description
} = job;
2015-08-25 14:36:07 -07:00
return (
2015-08-26 11:13:58 -07:00
<Well>
<Thumbnail
alt='200x200' src={ logo }
style={ thumbnailStyle } />
<Panel>
Position: { position }
Location: { city }, { state }
<br />
Contact: { email || phone || 'N/A' }
<br />
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
</Panel>
<p>{ description }</p>
</Well>
2015-08-25 14:36:07 -07:00
);
}
});