split jobs routes, add show comp

This commit is contained in:
Berkeley Martinez
2015-08-29 01:00:52 -07:00
parent ef5715fa24
commit ac193dc4c4
4 changed files with 79 additions and 57 deletions

View File

@ -52,7 +52,8 @@ export default contain(
key={ id }>
<Well>
<Thumbnail
alt='200x200' src={ logo }
alt={ company + 'company logo' }
src={ logo }
style={ thumbnailStyle } />
<Panel>
Position: { position }

View File

@ -1,5 +1,6 @@
import React, { PropTypes } from 'react';
import { Thumbnail, Panel, Well } from 'react-bootstrap';
import { contain } from 'thundercats-react';
import { Row, Thumbnail, Panel, Well } from 'react-bootstrap';
import moment from 'moment';
const thumbnailStyle = {
@ -7,10 +8,20 @@ const thumbnailStyle = {
maxHeight: '100px',
maxWidth: '100px'
};
export default React.createClass({
export default contain(
{
store: 'jobsStore',
fetchAction: 'jobActions.getJob',
getPayload({ params }) {
return { id: params.id };
}
},
React.createClass({
displayName: 'ShowJob',
propTypes: {
job: PropTypes.object
job: PropTypes.object,
params: PropTypes.object
},
renderHeader({ company, position }) {
@ -32,6 +43,7 @@ export default React.createClass({
logo,
position,
city,
company,
state,
email,
phone,
@ -40,9 +52,12 @@ export default React.createClass({
} = job;
return (
<div>
<Row>
<Well>
<Thumbnail
alt='200x200' src={ logo }
alt={ company + 'company logo' }
src={ logo }
style={ thumbnailStyle } />
<Panel>
Position: { position }
@ -54,6 +69,9 @@ export default React.createClass({
</Panel>
<p>{ description }</p>
</Well>
</Row>
</div>
);
}
});
})
);

View File

@ -5,9 +5,7 @@ const debug = debugFactory('freecc:jobs:actions');
export default Actions({
setJobs: null,
getJob(id) {
return { id };
},
getJob: null,
getJobs(params) {
return { params };
}

View File

@ -1,14 +1,19 @@
import Jobs from './components/Jobs.jsx';
import Show from './components/Show.jsx';
/*
* show: /jobs
* showOne: /jobs/:id
* edit /jobs/:id
* delete /jobs/:id
* createOne /jobs/new
* index: /jobs list jobs
* show: /jobs/:id show one job
* create /jobs/new create a new job
*/
export default {
path: 'jobs',
childRoutes: [{
path: 'jobs',
component: Jobs
}, {
path: 'jobs/:id',
component: Show
}]
};