Fix lint errors. Add more copy

This commit is contained in:
Berkeley Martinez
2015-10-16 20:05:22 -07:00
parent 2b9e19cff1
commit 2b6a84c1f5
4 changed files with 51 additions and 24 deletions

View File

@ -10,3 +10,11 @@ a.jobs-list-highlight:hover {
cursor: pointer; cursor: pointer;
cursor: hand; cursor: hand;
} }
.jobs-checkbox-spacer input[type="checkbox"] {
margin-left: -23px
}
.jobs-checkbox-spacer label {
padding-left: 130px
}

View File

@ -1,36 +1,36 @@
import React, { cloneElement, PropTypes } from 'react'; import React, { cloneElement, PropTypes } from 'react';
import { contain } from 'thundercats-react'; import { contain } from 'thundercats-react';
import { History } from 'react-router';
import { Button, Panel, Row, Col } from 'react-bootstrap'; import { Button, Panel, Row, Col } from 'react-bootstrap';
import CreateJobModal from './CreateJobModal.jsx';
import ListJobs from './List.jsx'; import ListJobs from './List.jsx';
export default contain( export default contain(
{ {
store: 'jobsStore', store: 'jobsStore',
fetchAction: 'jobActions.getJobs', fetchAction: 'jobActions.getJobs',
actions: 'jobActions' actions: [
'appActions',
'jobActions'
]
}, },
React.createClass({ React.createClass({
displayName: 'Jobs', displayName: 'Jobs',
mixins: [History],
propTypes: { propTypes: {
children: PropTypes.element, children: PropTypes.element,
appActions: PropTypes.object,
jobActions: PropTypes.object, jobActions: PropTypes.object,
jobs: PropTypes.array, jobs: PropTypes.array,
showModal: PropTypes.bool showModal: PropTypes.bool
}, },
handleJobClick(id) { handleJobClick(id) {
const { jobActions } = this.props; const { appActions, jobActions } = this.props;
if (!id) { if (!id) {
return null; return null;
} }
jobActions.findJob(id); jobActions.findJob(id);
this.history.pushState(null, `/jobs/${id}`); appActions.goTo(`/jobs/${id}`);
}, },
renderList(handleJobClick, jobs) { renderList(handleJobClick, jobs) {
@ -55,8 +55,7 @@ export default contain(
const { const {
children, children,
jobs, jobs,
showModal, appActions
jobActions
} = this.props; } = this.props;
return ( return (
@ -77,17 +76,25 @@ export default contain(
</p> </p>
</Col> </Col>
<Col <Col
xs={ 12 }
sm={ 8 } sm={ 8 }
smOffset={ 2 }> smOffset={ 2 }
xs={ 12 }>
<Button <Button
bsSize='large' bsSize='large'
className='signup-btn btn-block' className='signup-btn btn-block'
onClick={ ()=> {this.history.pushState(null, "/jobs/new")} }> onClick={ ()=> {
appActions.goTo('/jobs/new');
}}>
Post a job: $200 for 30 days + weekly tweets Post a job: $200 for 30 days + weekly tweets
</Button> </Button>
<div className='button-spacer' /> <div className='button-spacer' />
<a href="https://twitter.com/CamperJobs" className="twitter-follow-button" data-show-count="false" data-size="large">Follow @CamperJobs</a> <a
className='twitter-follow-button'
data-show-count='false'
data-size='large'
href='https://twitter.com/CamperJobs'>
Follow @CamperJobs
</a>
<div className='spacer' /> <div className='spacer' />
</Col> </Col>
</Row> </Row>

View File

@ -11,6 +11,17 @@ export default React.createClass({
jobs: PropTypes.array jobs: PropTypes.array
}, },
addLocation(locale) {
if (!locale) {
return null;
}
return (
<span className='hidden-xs hidden-sm'>
{ locale } - {' '}
</span>
);
},
renderJobs(handleClick, jobs = []) { renderJobs(handleClick, jobs = []) {
return jobs return jobs
.filter(({ isPaid, isApproved, isFilled }) => { .filter(({ isPaid, isApproved, isFilled }) => {
@ -42,14 +53,11 @@ export default React.createClass({
<span className='hidden-xs hidden-sm'> <span className='hidden-xs hidden-sm'>
- { position } - { position }
</span> </span>
{' '}
<span className='hidden-xs hidden-sm'>
({ locale })
</span>
</h4> </h4>
<h4 <h4
className='pull-right' className='pull-right'
style={{ display: 'inline-block' }}> style={{ display: 'inline-block' }}>
{ this.addLocation(locale) }
{ moment(new Date(postedOn)).format('MMM Do') } { moment(new Date(postedOn)).format('MMM Do') }
</h4> </h4>
</div> </div>

View File

@ -37,6 +37,9 @@ const checkValidity = [
'company', 'company',
'highlight' 'highlight'
]; ];
const hightlightCopy = `
Highlight my post to make it stand out. (+$50)
`;
function formatValue(value, validator, type = 'string') { function formatValue(value, validator, type = 'string') {
const formated = getDefaults(type); const formated = getDefaults(type);
@ -214,7 +217,9 @@ export default contain({
label='Job Title' label='Job Title'
labelClassName={ labelClass } labelClassName={ labelClass }
onChange={ (e) => handleChange('position', e) } onChange={ (e) => handleChange('position', e) }
placeholder='e.g. Full Stack Developer, Front End Developer, etc.' placeholder={
'e.g. Full Stack Developer, Front End Developer, etc.'
}
required={ true } required={ true }
type='text' type='text'
value={ position.value } value={ position.value }
@ -289,19 +294,18 @@ export default contain({
value={ logo.value } value={ logo.value }
wrapperClassName={ inputClass } /> wrapperClassName={ inputClass } />
<div className='divider'> <div className='divider' />
<h2>Highlight your listing to make it stand out</h2>
</div>
<Input <Input
checked={ highlight.value } checked={ highlight.value }
label="&thinsp;&thinsp;&thinsp;Sure - I'll pay $50 more for that." label={ hightlightCopy }
labelClassName={ 'col-sm-offset-1 col-sm-6'} labelClassName={ 'col-sm-offset-1 col-sm-6' }
onChange={ onChange={
({ target: { checked } }) => handleForm({ ({ target: { checked } }) => handleForm({
highlight: !!checked highlight: !!checked
}) })
} }
type='checkbox' /> type='checkbox'
wrapperClassName='jobs-checkbox-spacer' />
<div className='spacer' /> <div className='spacer' />
<Row> <Row>
<Col <Col