Finish copy, add flags

This commit is contained in:
Berkeley Martinez
2015-10-20 15:01:05 -07:00
parent 1319a563c7
commit ac8a1a3f6f
4 changed files with 75 additions and 88 deletions

View File

@ -19,7 +19,7 @@ export default contain(
}, },
render() { render() {
const { id } = this.props; const { id, isHighlighted } = this.props;
return ( return (
<div> <div>
<Row> <Row>
@ -58,7 +58,10 @@ export default contain(
<input <input
name='hosted_button_id' name='hosted_button_id'
type='hidden' type='hidden'
value='ZVU498PLMPHKU' /> value={ isHighlighted ?
'' :
'ZVU498PLMPHKU'
} />
<input <input
name='custom' name='custom'
type='hidden' type='hidden'

View File

@ -22,7 +22,6 @@ import {
import { import {
isAscii, isAscii,
isEmail, isEmail,
isMobilePhone,
isURL isURL
} from 'validator'; } from 'validator';
@ -33,7 +32,6 @@ const checkValidity = [
'locale', 'locale',
'description', 'description',
'email', 'email',
'phone',
'url', 'url',
'logo', 'logo',
'company', 'company',
@ -43,16 +41,20 @@ const hightlightCopy = `
Highlight my post to make it stand out. (+$50) Highlight my post to make it stand out. (+$50)
`; `;
const foo = `
This will narrow the field substantially with higher quality applicants
`;
const isFullStackCopy = ` const isFullStackCopy = `
Only allow full stack certified students to apply. Applicants must have Free Code Camps Full Stack Certification to apply.*
`; `;
const isFrontEndCopy = ` const isFrontEndCopy = `
Only allow front end certified students to apply. Applicants must have Free Code Camps Front End Certification to apply.*
`; `;
const isRemoteCopy = ` const isRemoteCopy = `
This job can be done remotely. This job can be performed remotely.
`; `;
const checkboxClass = dedent` const checkboxClass = dedent`
@ -78,10 +80,6 @@ function isValidURL(data) {
return isURL(data, { 'require_protocol': true }); return isURL(data, { 'require_protocol': true });
} }
function isValidPhone(data) {
return isMobilePhone(data, 'en-US');
}
function makeRequired(validator) { function makeRequired(validator) {
return (val) => !!val && validator(val); return (val) => !!val && validator(val);
} }
@ -95,7 +93,6 @@ export default contain({
locale, locale,
description, description,
email, email,
phone,
url, url,
logo, logo,
company, company,
@ -109,7 +106,6 @@ export default contain({
locale: formatValue(locale, makeRequired(isAscii)), locale: formatValue(locale, makeRequired(isAscii)),
description: formatValue(description, makeRequired(isAscii)), description: formatValue(description, makeRequired(isAscii)),
email: formatValue(email, makeRequired(isEmail)), email: formatValue(email, makeRequired(isEmail)),
phone: formatValue(phone, isValidPhone),
url: formatValue(url, isValidURL), url: formatValue(url, isValidURL),
logo: formatValue(logo, isValidURL), logo: formatValue(logo, isValidURL),
company: formatValue(company, makeRequired(isAscii)), company: formatValue(company, makeRequired(isAscii)),
@ -132,7 +128,6 @@ export default contain({
locale: PropTypes.object, locale: PropTypes.object,
description: PropTypes.object, description: PropTypes.object,
email: PropTypes.object, email: PropTypes.object,
phone: PropTypes.object,
url: PropTypes.object, url: PropTypes.object,
logo: PropTypes.object, logo: PropTypes.object,
company: PropTypes.object, company: PropTypes.object,
@ -168,7 +163,6 @@ export default contain({
locale, locale,
description, description,
email, email,
phone,
url, url,
logo, logo,
company, company,
@ -184,7 +178,6 @@ export default contain({
locale: inHTMLData(locale.value), locale: inHTMLData(locale.value),
description: inHTMLData(description.value), description: inHTMLData(description.value),
email: inHTMLData(email.value), email: inHTMLData(email.value),
phone: inHTMLData(phone.value),
url: uriInSingleQuotedAttr(url.value), url: uriInSingleQuotedAttr(url.value),
logo: uriInSingleQuotedAttr(logo.value), logo: uriInSingleQuotedAttr(logo.value),
company: inHTMLData(company.value), company: inHTMLData(company.value),
@ -224,7 +217,6 @@ export default contain({
locale, locale,
description, description,
email, email,
phone,
url, url,
logo, logo,
company, company,
@ -285,67 +277,6 @@ export default contain({
type='textarea' type='textarea'
value={ description.value } value={ description.value }
wrapperClassName={ inputClass } /> wrapperClassName={ inputClass } />
<div className='divider'>
<h2>Tell us about your organization</h2>
</div>
<Input
bsStyle={ company.bsStyle }
label='Company Name'
labelClassName={ labelClass }
onChange={ (e) => handleChange('company', e) }
type='text'
value={ company.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ email.bsStyle }
label='Email'
labelClassName={ labelClass }
onChange={ (e) => handleChange('email', e) }
placeholder='you@yourcompany.com'
required={ true }
type='email'
value={ email.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ phone.bsStyle }
label='Phone'
labelClassName={ labelClass }
onChange={ (e) => handleChange('phone', e) }
placeholder='555-867-5309'
type='tel'
value={ phone.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ url.bsStyle }
label='URL'
labelClassName={ labelClass }
onChange={ (e) => handleChange('url', e) }
placeholder='http://freecodecamp.com'
type='url'
value={ url.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ logo.bsStyle }
label='Logo'
labelClassName={ labelClass }
onChange={ (e) => handleChange('logo', e) }
placeholder='http://freecatphotoapp.com/logo.png'
type='url'
value={ logo.value }
wrapperClassName={ inputClass } />
<div className='divider' />
<Input
checked={ isHighlighted.value }
label={ hightlightCopy }
onChange={
({ target: { checked } }) => handleForm({
isHighlighted: !!checked
})
}
type='checkbox'
wrapperClassName={ checkboxClass } />
<Input <Input
checked={ isFrontEndCert.value } checked={ isFrontEndCert.value }
label={ isFrontEndCopy } label={ isFrontEndCopy }
@ -376,6 +307,62 @@ export default contain({
} }
type='checkbox' type='checkbox'
wrapperClassName={ checkboxClass } /> wrapperClassName={ checkboxClass } />
<Row>
<small>* { foo }</small>
</Row>
<div className='spacer' />
<div className='divider'>
<h2>Tell us about your organization</h2>
</div>
<Input
bsStyle={ company.bsStyle }
label='Company Name'
labelClassName={ labelClass }
onChange={ (e) => handleChange('company', e) }
type='text'
value={ company.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ email.bsStyle }
label='Email'
labelClassName={ labelClass }
onChange={ (e) => handleChange('email', e) }
placeholder='This is how we will contact you'
required={ true }
type='email'
value={ email.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ url.bsStyle }
label='URL'
labelClassName={ labelClass }
onChange={ (e) => handleChange('url', e) }
placeholder='http://yourcompany.com'
type='url'
value={ url.value }
wrapperClassName={ inputClass } />
<Input
bsStyle={ logo.bsStyle }
label='Logo'
labelClassName={ labelClass }
onChange={ (e) => handleChange('logo', e) }
placeholder='http://yourcompany.com/logo.png'
type='url'
value={ logo.value }
wrapperClassName={ inputClass } />
<div className='spacer' />
<Input
checked={ isHighlighted.value }
label={ hightlightCopy }
onChange={
({ target: { checked } }) => handleForm({
isHighlighted: !!checked
})
}
type='checkbox'
wrapperClassName={ checkboxClass } />
<div className='spacer' /> <div className='spacer' />
<Row> <Row>
<Col <Col

View File

@ -5,25 +5,22 @@ import { Button, Panel, Col, Row } from 'react-bootstrap';
export default React.createClass({ export default React.createClass({
displayName: 'NewJobCompleted', displayName: 'NewJobCompleted',
propTypes: {
},
render() { render() {
return ( return (
<div> <div className='text-center'>
<Panel> <Panel>
<Row> <Row>
<h1 className='text-center'> <h1>
Job under review Your Position has Been Submitted
</h1> </h1>
</Row> </Row>
<Row> <Row>
<Col <Col
md={ 6 } md={ 6 }
mdOffset={ 3 }> mdOffset={ 3 }>
Congrats! Your job has been posted and is under review. Well review your listing and email you when its live.
Once we review you job post we will publish it and you will receive <br />
an email from us with a link to the listing. Thank you for listing this job with Free Code Camp.
</Col> </Col>
</Row> </Row>
<div className='spacer' /> <div className='spacer' />

View File

@ -36,7 +36,7 @@ export default contain(
render() { render() {
const { appActions, job, jobActions } = this.props; const { appActions, job, jobActions } = this.props;
if (!job || !job.position || job.description) { if (!job || !job.position || !job.description) {
return <JobNotFound />; return <JobNotFound />;
} }