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 }> key={ id }>
<Well> <Well>
<Thumbnail <Thumbnail
alt='200x200' src={ logo } alt={ company + 'company logo' }
src={ logo }
style={ thumbnailStyle } /> style={ thumbnailStyle } />
<Panel> <Panel>
Position: { position } Position: { position }

View File

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

View File

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

View File

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