Fakultas Ilmu Komputer UI

Commit 177ed6ab authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

#140654507 #13 Change VacancyPage logic flow

parent 7b36e111
import React from 'react'; import React from 'react';
import { Segment, Input, Menu } from 'semantic-ui-react'
import Tabs from './components/Tabs'; import Tabs from './components/Tabs';
import Pane from './components/Pane'; import Pane from './components/Pane';
import VacancyList from './components/VacancyList'; import VacancyList from './components/VacancyList';
import Server from './lib/Server';
export default class VacancyPage extends React.Component { export default class VacancyPage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
/* istanbul ignore next */ /* istanbul ignore next */
this.state = { email: '', password: '', errorFlag: false }; this.state = {
email: '',
password: '',
errorFlag: false,
vacancies: []
};
this.handleItemClick = this.handleItemClick.bind(this); this.handleItemClick = this.handleItemClick.bind(this);
} }
handleItemClick = (e, { name }) => this.setState({ activeItem: name }); handleItemClick = (e, { name }) => this.setState({ activeItem: name });
fetchVacancies(url) {
Server.get(url).then((data) => {
this.setState({ vacancies: data });
}, () => {
});
}
render() { render() {
const data = [{ data1: 'val1' }, { data1: 'val2' }]; const data = [{ data1: 'val1' }, { data1: 'val2' }];
const {activeItem} = this.state;
return (<div> return (<div>
<Tabs selected={0}> <Tabs selected={0}>
<Pane label="Semua Lowongan"> <Pane label="Semua Lowongan" >
<VacancyList vacancies={data} /> <VacancyList vacancies={data} />
{ this.fetchVacancies('/api') }
</Pane> </Pane>
<Pane label="Lamaran saya"> <Pane label="Lamaran saya" >
<div>This is my tab 2 contents!</div> <VacancyList vacancies={data} />
{ this.fetchVacancies('/api') }
</Pane>
<Pane label="Lamaran Ditandai" >
<VacancyList vacancies={data} />
{ this.fetchVacancies('/api') }
</Pane> </Pane>
</Tabs> </Tabs>
</div> </div>
); );
}; }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment