diff --git a/common/app/routes/Jobs/components/List.jsx b/common/app/routes/Jobs/components/List.jsx index b90050aa74..1688cc42e1 100644 --- a/common/app/routes/Jobs/components/List.jsx +++ b/common/app/routes/Jobs/components/List.jsx @@ -52,7 +52,8 @@ export default contain( key={ id }> Position: { position } diff --git a/common/app/routes/Jobs/components/Show.jsx b/common/app/routes/Jobs/components/Show.jsx index 209917cff7..43bb22c667 100644 --- a/common/app/routes/Jobs/components/Show.jsx +++ b/common/app/routes/Jobs/components/Show.jsx @@ -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,53 +8,70 @@ const thumbnailStyle = { maxHeight: '100px', maxWidth: '100px' }; -export default React.createClass({ - displayName: 'ShowJob', - propTypes: { - job: PropTypes.object + +export default contain( + { + store: 'jobsStore', + fetchAction: 'jobActions.getJob', + getPayload({ params }) { + return { id: params.id }; + } }, + React.createClass({ + displayName: 'ShowJob', + propTypes: { + job: PropTypes.object, + params: PropTypes.object + }, - renderHeader({ company, position }) { - return ( -
-

{ company }

-
- { position } -
-
- ); - }, + renderHeader({ company, position }) { + return ( +
+

{ company }

+
+ { position } +
+
+ ); + }, - render() { - const { job } = this.props; - const { - logo, - position, - city, - state, - email, - phone, - postedOn, - description - } = job; + render() { + const { job } = this.props; + const { + logo, + position, + city, + company, + state, + email, + phone, + postedOn, + description + } = job; - return ( - - - - Position: { position } - Location: { city }, { state } -
- Contact: { email || phone || 'N/A' } -
- Posted On: { moment(postedOn).format('MMMM Do, YYYY') } -
-

{ description }

-
- ); - } -}); + return ( +
+ + + + + Position: { position } + Location: { city }, { state } +
+ Contact: { email || phone || 'N/A' } +
+ Posted On: { moment(postedOn).format('MMMM Do, YYYY') } +
+

{ description }

+
+
+
+ ); + } + }) +); diff --git a/common/app/routes/Jobs/flux/Actions.js b/common/app/routes/Jobs/flux/Actions.js index 68d5eeae57..f74c8092a4 100644 --- a/common/app/routes/Jobs/flux/Actions.js +++ b/common/app/routes/Jobs/flux/Actions.js @@ -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 }; } diff --git a/common/app/routes/Jobs/index.js b/common/app/routes/Jobs/index.js index 9d52bf2b53..1148cf265a 100644 --- a/common/app/routes/Jobs/index.js +++ b/common/app/routes/Jobs/index.js @@ -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', - component: Jobs + childRoutes: [{ + path: 'jobs', + component: Jobs + }, { + path: 'jobs/:id', + component: Show + }] };