Add logic to cert buttons

This commit is contained in:
Berkeley Martinez
2015-11-04 14:23:42 -08:00
parent 1251b14d9d
commit feac941b1c

View File

@ -114,7 +114,7 @@ export default contain({
url, url,
logo, logo,
company, company,
isFrontEndCert, isFrontEndCert = true,
isFullStackCert, isFullStackCert,
isHighlighted, isHighlighted,
isRemoteOk, isRemoteOk,
@ -171,7 +171,7 @@ export default contain({
} }
}); });
if (!valid) { if (!valid || !props.isFrontEndCert && !props.isFullStackCert ) {
debug('form not valid'); debug('form not valid');
return; return;
} }
@ -234,6 +234,18 @@ export default contain({
handleForm({ [name]: value }); handleForm({ [name]: value });
}, },
handleCertClick(name) {
const { jobActions: { handleForm } } = this.props;
const otherButton = name === 'isFrontEndCert' ?
'isFullStackCert' :
'isFrontEndCert';
handleForm({
[name]: true,
[otherButton]: false
});
},
render() { render() {
const { const {
position, position,
@ -275,7 +287,11 @@ export default contain({
xs={ 6 } xs={ 6 }
xsOffset={ 3 }> xsOffset={ 3 }>
<Row> <Row>
<Button className={ isFrontEndCert ? '' : 'active' }> <Button
className={ isFrontEndCert ? 'active' : '' }
onClick={ () => this.handleCertClick(
'isFrontEndCert'
)}>
<h4>Front End Development Certified</h4> <h4>Front End Development Certified</h4>
You can expect each applicant You can expect each applicant
to have a code portfolio using the to have a code portfolio using the
@ -287,7 +303,11 @@ export default contain({
</Row> </Row>
<div className='button-spacer' /> <div className='button-spacer' />
<Row> <Row>
<Button className={ isFullStackCert ? 'active' : ''}> <Button
className={ isFullStackCert ? 'active' : ''}
onClick={ () => this.handleCertClick(
'isFullStackCert'
)}>
<h4>Full Stack Development Certified</h4> <h4>Full Stack Development Certified</h4>
You can expect each applicant to have a code You can expect each applicant to have a code
portfolio using the following technologies: portfolio using the following technologies: