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,31 +60,29 @@ export default contain(
} = this.props; } = this.props;
return ( return (
<div> <Panel>
<h1>Free Code Camps' Job Board</h1>
<Row> <Row>
<Jumbotron> <p>
<h1>Free Code Camps' Job Board</h1> Need to find the best junior developers?
<p> Want to find dedicated developers eager to join your company?
Need to find the best junior developers? Sign up now to post your job!
Want to find dedicated developers eager to join your company? </p>
Sign up now to post your job! <Button
</p> bsSize='large'
<Button className='signup-btn'
bsSize='large' onClick={ jobActions.openModal }>
className='signup-btn' Post a job: $200 for 60 days.
onClick={ jobActions.openModal }> </Button>
Try the first month 20% off!
</Button>
</Jumbotron>
</Row> </Row>
<Row> <Row>
{ this.renderChild(children, jobs) || { this.renderChild(children, jobs) ||
this.renderList(this.handleJobClick, jobs) } this.renderList(this.handleJobClick, jobs) }
</Row> </Row>
<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({
@ -10,64 +10,40 @@ export default React.createClass({
jobs: PropTypes.array jobs: PropTypes.array
}, },
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 return (
) => { <ListGroupItem
const header = ( className={ isHighlighted ? 'jobs-list-highlight' : '' }
<div> onClick={ () => handleClick(id) }>
<h4 style={{ display: 'inline-block' }}>{ company }</h4> <div>
<h5 <h4 style={{ display: 'inline-block' }}>
className='pull-right hidden-xs hidden-md' <span>{ company }</span>
style={{ display: 'inline-block' }}> {' '}
{ position } <span className='hidden-xs hidden-sm'>
</h5> - { position }
</div> </span>
); {' '}
return ( </h4>
<Panel <h4
bsStyle={ isHighlighted ? 'warning' : 'default' } className='pull-right'
collapsible={ true } style={{ display: 'inline-block' }}>
eventKey={ index } { moment(new Date(postedOn)).format('MMM Do') }
header={ header } </h4>
key={ id }> </div>
<Well> </ListGroupItem>
<Thumbnail );
alt={ company + 'company logo' } });
src={ logo }
style={ thumbnailStyle } />
<Panel>
Position: { position }
Location: { city }, { state }
<br />
Contact: { email || phone || 'N/A' }
<br />
Posted On: { moment(postedOn).format('MMMM Do, YYYY') }
</Panel>
<p onClick={ () => handleClick(id) }>{ description }</p>
</Well>
</Panel>
);
});
}, },
render() { render() {
@ -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",