Make list an actual list instead of accordion

This commit is contained in:
Berkeley Martinez
2015-10-15 20:03:07 -07:00
parent da26f19cde
commit a65384e698
6 changed files with 74 additions and 85 deletions

7
client/less/jobs.less Normal file
View File

@ -0,0 +1,7 @@
.jobs-list-highlight {
background-color: #ffc
}
a.jobs-list-highlight:hover {
background-color: #ffc
}

View File

@ -955,11 +955,12 @@ code {
margin: 0!important; margin: 0!important;
} }
// gitter chat
.gitter-chat-embed { .gitter-chat-embed {
z-index: 20000 !important; z-index: 20000 !important;
} }
@import "jobs.less";
//uncomment this to see the dimensions of all elements outlined in red //uncomment this to see the dimensions of all elements outlined in red
//* { //* {
// border-color: red; // border-color: red;

View File

@ -1,5 +1,5 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
import { Col, Well, Row } from 'react-bootstrap'; import { Col, Panel, Row } from 'react-bootstrap';
import { contain } from 'thundercats-react'; import { contain } from 'thundercats-react';
export default contain( export default contain(
@ -23,12 +23,12 @@ export default contain(
<div> <div>
<Row> <Row>
<Col <Col
xs={ 12 } md={ 6 }
mdOffset={ 3 }
sm={ 8 } sm={ 8 }
smOffset={ 2 } smOffset={ 2 }
md={ 6 } xs={ 12 }>
mdOffset={ 3 }> <Panel>
<Well>
<form <form
action='https://www.sandbox.paypal.com/cgi-bin/webscr' action='https://www.sandbox.paypal.com/cgi-bin/webscr'
method='post' method='post'
@ -61,7 +61,7 @@ export default contain(
src='https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif' src='https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif'
width='1' /> width='1' />
</form> </form>
</Well> </Panel>
</Col> </Col>
</Row> </Row>
</div> </div>

View File

@ -1,7 +1,7 @@
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 { History } from 'react-router';
import { Button, Jumbotron, Row } from 'react-bootstrap'; import { Button, Panel, Row } from 'react-bootstrap';
import CreateJobModal from './CreateJobModal.jsx'; import CreateJobModal from './CreateJobModal.jsx';
import ListJobs from './List.jsx'; import ListJobs from './List.jsx';
@ -60,10 +60,9 @@ export default contain(
} = this.props; } = this.props;
return ( return (
<div> <Panel>
<Row>
<Jumbotron>
<h1>Free Code Camps' Job Board</h1> <h1>Free Code Camps' Job Board</h1>
<Row>
<p> <p>
Need to find the best junior developers? Need to find the best junior developers?
Want to find dedicated developers eager to join your company? Want to find dedicated developers eager to join your company?
@ -73,9 +72,8 @@ export default contain(
bsSize='large' bsSize='large'
className='signup-btn' className='signup-btn'
onClick={ jobActions.openModal }> onClick={ jobActions.openModal }>
Try the first month 20% off! Post a job: $200 for 60 days.
</Button> </Button>
</Jumbotron>
</Row> </Row>
<Row> <Row>
{ this.renderChild(children, jobs) || { this.renderChild(children, jobs) ||
@ -84,7 +82,7 @@ export default contain(
<CreateJobModal <CreateJobModal
onHide={ jobActions.closeModal } onHide={ jobActions.closeModal }
showModal={ showModal } /> showModal={ showModal } />
</div> </Panel>
); );
} }
}) })

View File

@ -1,5 +1,5 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
import { PanelGroup, Thumbnail, Panel, Well } from 'react-bootstrap'; import { ListGroup, ListGroupItem } from 'react-bootstrap';
import moment from 'moment'; import moment from 'moment';
export default React.createClass({ export default React.createClass({
@ -11,61 +11,37 @@ export default React.createClass({
}, },
renderJobs(handleClick, jobs = []) { renderJobs(handleClick, jobs = []) {
const thumbnailStyle = { return jobs
backgroundColor: 'white', .filter(({ isPaid, isApproved, isFilled }) => {
maxHeight: '100px', return isPaid && isApproved && !isFilled;
maxWidth: '100px' })
}; .map(({
return jobs.map((
{
id, id,
company, company,
position, position,
isHighlighted, isHighlighted,
description,
logo,
city,
state,
email,
phone,
postedOn postedOn
}, }) => {
index
) => {
const header = (
<div>
<h4 style={{ display: 'inline-block' }}>{ company }</h4>
<h5
className='pull-right hidden-xs hidden-md'
style={{ display: 'inline-block' }}>
{ position }
</h5>
</div>
);
return ( return (
<Panel <ListGroupItem
bsStyle={ isHighlighted ? 'warning' : 'default' } className={ isHighlighted ? 'jobs-list-highlight' : '' }
collapsible={ true } onClick={ () => handleClick(id) }>
eventKey={ index } <div>
header={ header } <h4 style={{ display: 'inline-block' }}>
key={ id }> <span>{ company }</span>
<Well> {' '}
<Thumbnail <span className='hidden-xs hidden-sm'>
alt={ company + 'company logo' } - { position }
src={ logo } </span>
style={ thumbnailStyle } /> {' '}
<Panel> </h4>
Position: { position } <h4
Location: { city }, { state } className='pull-right'
<br /> style={{ display: 'inline-block' }}>
Contact: { email || phone || 'N/A' } { moment(new Date(postedOn)).format('MMM Do') }
<br /> </h4>
Posted On: { moment(postedOn).format('MMMM Do, YYYY') } </div>
</Panel> </ListGroupItem>
<p onClick={ () => handleClick(id) }>{ description }</p>
</Well>
</Panel>
); );
}); });
}, },
@ -77,9 +53,9 @@ export default React.createClass({
} = this.props; } = this.props;
return ( return (
<PanelGroup> <ListGroup>
{ this.renderJobs(handleClick, jobs) } { this.renderJobs(handleClick, jobs) }
</PanelGroup> </ListGroup>
); );
} }
}); });

View File

@ -48,13 +48,20 @@
"type": "string" "type": "string"
}, },
"isApproved": { "isApproved": {
"type": "boolean" "type": "boolean",
"default": false
}, },
"isHighlighted": { "isHighlighted": {
"type": "boolean" "type": "boolean",
"default": false
}, },
"isPaid": { "isPaid": {
"type": "boolean" "type": "boolean",
"default": false
},
"isFilled": {
"type": "boolean",
"default": false
}, },
"postedOn": { "postedOn": {
"type": "date", "type": "date",