Fakultas Ilmu Komputer UI

VacancyPage.jsx 1.34 KB
Newer Older
1
2
3
import React from 'react';
import Tabs from './components/Tabs';
import Pane from './components/Pane';
4
import Storage from './lib/Storage';
5
6
7
8
9
10
11
import VacancyList from './components/VacancyList';

export default class VacancyPage extends React.Component {

  constructor(props) {
    super(props);
    /* istanbul ignore next */
12
13
14
15
    this.state = {
      email: '',
      password: '',
      errorFlag: false,
16
      vacancies: [],
17
      student: false,
18
    };
19
20
    Storage.getUserData().then(r => this.setState({ student: r.student }));

21
22
23
24
25
    this.handleItemClick = this.handleItemClick.bind(this);
  }

  handleItemClick = (e, { name }) => this.setState({ activeItem: name });

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  render = () => (
    this.state.student && (
      <div className="halamanLowongan">
        <Tabs selected={0}>
          <Pane label="Semua Lowongan" >
            <VacancyList key={1} studentId={this.state.student.id} url="/vacancies/" />
          </Pane>
          <Pane label="Lamaran saya" >
            <VacancyList key={2} status="Batal" studentId={this.state.student.id} url={`/students/${this.state.student.id}/applied-vacancies/`} />
          </Pane>
          <Pane label="Lamaran Ditandai" >
            <VacancyList key={3} studentId={this.state.student.id} url={`/students/${this.state.student.id}/bookmarked-vacancies/`} />
          </Pane>
        </Tabs>
      </div>
    )
  );
43
}