Skip to content

Commit

Permalink
Merge pull request #10 from FAC7/CandidateProfileModal
Browse files Browse the repository at this point in the history
add candidate profile (modal) #2
  • Loading branch information
franzmoro committed Apr 16, 2016
2 parents 51a1f49 + f9577e9 commit 2fabcc4
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from 'react'
import {Button, Modal} from 'react-bootstrap'

const CandidateProfileModal = React.createClass ({
close() {
this.props.changeState({ showModal: false });
},

open() {
this.props.changeState({ showModal: true });
},

render() {

return (
<div>

<Button
bsStyle='primary'
bsSize='large'
onClick={this.open}
>
{this.props.name} profile
</Button>

<Modal show={this.props.showModal} onHide={this.close}>

<Modal.Header closeButton>
<Modal.Title>{this.props.name}</Modal.Title>
</Modal.Header>

<Modal.Body>

<p>email: {this.props.email} {this.props.telephone}</p>
<p>Telephone number: {this.props.telephone}</p>
<p>University: {this.props.University}</p>
<p>Degree: {this.props.Degree}</p>
<p>Click here to see the {this.props.name} CV: {this.props.resumeLink}</p>
<p>Description: {this.props.description}</p>

</Modal.Body>

<Modal.Footer>
<Button onClick={this.close}>Close</Button>
</Modal.Footer>

</Modal>

</div>
)
}

})

CandidateProfileModal.propTypes = {
name: React.PropTypes.string.isRequired,
email: React.PropTypes.string.isRequired,
telephone: React.PropTypes.string.isRequired,
University: React.PropTypes.string.isRequired,
Degree: React.PropTypes.string.isRequired,
resumeLink: React.PropTypes.string.isRequired,
description: React.PropTypes.string.isRequired
}

CandidateProfileModal.defaultProps = {
name: 'Sam Package',
email: '[email protected]',
telephone: '07483849774',
University: 'Bristol',
Degree: 'Packages',
resumeLink: 'resume.com/resume.doc',
description: 'bla bla bla package bla'
}

export default CandidateProfileModal

4 changes: 2 additions & 2 deletions frontend/src/js/views/Candidate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import CandidateProfileModal from '../../components/CandidateProfile/CandidatePr
export default class CandidateView extends Component {
constructor () {
super()
this.state = {roles, candidates, showModal: false}
this.state = {roles, candidates, showModal: false, currentRole: null}
this.changeState = this.changeState.bind(this)
}
changeState (state) {
Expand All @@ -16,7 +16,7 @@ export default class CandidateView extends Component {
return (
<div>
<List candidates={this.state.candidates} roles={this.state.candidates} changeState={this.changeState} />
<CandidateProfileModal />
<CandidateProfileModal changeState={this.changeState} showModal={this.state.showModal} currentRole={this.state.currentRole}/>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/views/Host/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class HostView extends Component {
return (
<div>
<List candidates={this.state.candidates} changeState={this.changeState} />
<CandidateProfileModal />
<CandidateProfileModal changeState={this.changeState} showModal={this.state.showModal} currCandidate={this.state.currCandidate}/>
</div>
)
}
Expand Down

0 comments on commit 2fabcc4

Please sign in to comment.