Fakultas Ilmu Komputer UI

AdminVacancy.jsx 1.31 KB
Newer Older
1
import React from 'react';
2
import { Item, Grid, Icon, Button } from 'semantic-ui-react';
3
4
5
import VerifyAdminModal from './VerifyAdminModal';

export default class AdminVacancy extends React.Component {
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  static propTypes = {
    data: React.PropTypes.object.isRequired,
  };


  verifyVacancy(){
    //define here
  }
   unverifyVacancy(){
    //define here
  }

  generateButton(){
    const unverifyButton = <Button floated="right" color="red" onClick='{this.unverifyVacancy}'>Batalkan Verifikasi</Button>;
    const verifyButton = <Button floated="right" color="blue" onClick='{this.unverifyVacancy}'>Verifikasi</Button>;

    if(this.props.data.verified){
      return unverifyButton;
    }
    return verifyButton;
  }
27
28
29
30
31
32

  render() {
    return (
      <Item className="adminItems">
        <Item.Image src="http://semantic-ui.com/images/wireframe/image.png" size="small" />
        <Item.Content>
33
          <Item.Header as="a">{this.props.data.name}</Item.Header>
34
35
          <Grid.Row>
            <Grid.Column floated="left">
36
37
              <h4>{this.props.data.company.name} </h4>
                {this.props.data.company.address}
38
39
            </Grid.Column>
            <Grid.Column floated="right">
40
              {this.generateButton()}
41
42
43
44
45
46
47
            </Grid.Column>
          </Grid.Row>
        </Item.Content>
      </Item>
    );
  }
}