Skip to content

Commit f9577e9

Browse files
author
Mireia
committed
add candidate profile (modal) #2
1 parent 51a1f49 commit f9577e9

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import React from 'react'
2+
import {Button, Modal} from 'react-bootstrap'
3+
4+
const CandidateProfileModal = React.createClass ({
5+
close() {
6+
this.props.changeState({ showModal: false });
7+
},
8+
9+
open() {
10+
this.props.changeState({ showModal: true });
11+
},
12+
13+
render() {
14+
15+
return (
16+
<div>
17+
18+
<Button
19+
bsStyle='primary'
20+
bsSize='large'
21+
onClick={this.open}
22+
>
23+
{this.props.name} profile
24+
</Button>
25+
26+
<Modal show={this.props.showModal} onHide={this.close}>
27+
28+
<Modal.Header closeButton>
29+
<Modal.Title>{this.props.name}</Modal.Title>
30+
</Modal.Header>
31+
32+
<Modal.Body>
33+
34+
<p>email: {this.props.email} {this.props.telephone}</p>
35+
<p>Telephone number: {this.props.telephone}</p>
36+
<p>University: {this.props.University}</p>
37+
<p>Degree: {this.props.Degree}</p>
38+
<p>Click here to see the {this.props.name} CV: {this.props.resumeLink}</p>
39+
<p>Description: {this.props.description}</p>
40+
41+
</Modal.Body>
42+
43+
<Modal.Footer>
44+
<Button onClick={this.close}>Close</Button>
45+
</Modal.Footer>
46+
47+
</Modal>
48+
49+
</div>
50+
)
51+
}
52+
53+
})
54+
55+
CandidateProfileModal.propTypes = {
56+
name: React.PropTypes.string.isRequired,
57+
email: React.PropTypes.string.isRequired,
58+
telephone: React.PropTypes.string.isRequired,
59+
University: React.PropTypes.string.isRequired,
60+
Degree: React.PropTypes.string.isRequired,
61+
resumeLink: React.PropTypes.string.isRequired,
62+
description: React.PropTypes.string.isRequired
63+
}
64+
65+
CandidateProfileModal.defaultProps = {
66+
name: 'Sam Package',
67+
email: 'sam.package@welovepackages.com',
68+
telephone: '07483849774',
69+
University: 'Bristol',
70+
Degree: 'Packages',
71+
resumeLink: 'resume.com/resume.doc',
72+
description: 'bla bla bla package bla'
73+
}
74+
75+
export default CandidateProfileModal
76+

frontend/src/js/views/Candidate/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import CandidateProfileModal from '../../components/CandidateProfile/CandidatePr
66
export default class CandidateView extends Component {
77
constructor () {
88
super()
9-
this.state = {roles, candidates, showModal: false}
9+
this.state = {roles, candidates, showModal: false, currentRole: null}
1010
this.changeState = this.changeState.bind(this)
1111
}
1212
changeState (state) {
@@ -16,7 +16,7 @@ export default class CandidateView extends Component {
1616
return (
1717
<div>
1818
<List candidates={this.state.candidates} roles={this.state.candidates} changeState={this.changeState} />
19-
<CandidateProfileModal />
19+
<CandidateProfileModal changeState={this.changeState} showModal={this.state.showModal} currentRole={this.state.currentRole}/>
2020
</div>
2121
)
2222
}

frontend/src/js/views/Host/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class HostView extends Component {
1616
return (
1717
<div>
1818
<List candidates={this.state.candidates} changeState={this.changeState} />
19-
<CandidateProfileModal />
19+
<CandidateProfileModal changeState={this.changeState} showModal={this.state.showModal} currCandidate={this.state.currCandidate}/>
2020
</div>
2121
)
2222
}

0 commit comments

Comments
 (0)