Fakultas Ilmu Komputer UI

ApproveModal.jsx 1.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
import { Modal, Button, Icon, TextArea, Form } from 'semantic-ui-react';
import ModalAlert from './ModalAlert';

export default class ApproveModal extends React.Component {
  static propTypes = {
    data: React.PropTypes.object.isRequired,
    id: React.PropTypes.number.isRequired,
    buttonTitle: React.PropTypes.string.isRequired,
  };

  constructor(props) {
    super(props);
    /* istanbul ignore next */
    this.state = {
      modalOpen: false,
    };
    this.handleOpen = this.handleOpen.bind(this);
  }


  handleOpen() {
    this.setState({ modalOpen: true });
  }

  handleClose = () => this.setState({
    modalOpen: false,
  });

  render = () => (
    <Modal

      trigger={<Button primary onClick={this.handleOpen} floated="right">{this.props.buttonTitle}</Button>}
      closeIcon="close"
      open={this.state.modalOpen}
      onClose={this.handleClose}
    >

      <Modal.Header>{this.props.data.header}</Modal.Header>

      <Modal.Content>

          <div className="coverLetter">

            <div className="linkCV">
            <a> Applicant's CV </a>
            </div>

            <h4> Cover Letter </h4>
            <h5>{this.props.data.description}</h5>

          </div>

      </Modal.Content>
      <Modal.Actions>
        <ModalAlert
          id={this.props.id}
          onChangeValue={this.handleClose}
          status="Terima"
        />
      </Modal.Actions>
    </Modal>
    )
}