Fakultas Ilmu Komputer UI

Commit 19c3fe93 authored by sirinbaisa's avatar sirinbaisa
Browse files

no message

parent d5edf82d
......@@ -3,6 +3,7 @@ import Tabs from './components/Tabs';
import Pane from './components/Pane';
import VacancyList from './components/VacancyList';
import Pagination from './components/Pagination';
import Applicants from './components/Applicants';
export default class VacancyPage extends React.Component {
......@@ -46,6 +47,7 @@ export default class VacancyPage extends React.Component {
/>
}
/>
<Applicants />
</Pane>
<Pane label="Lamaran saya" >
<Pagination
......
import React from 'react';
import { Header, Icon } from 'semantic-ui-react';
import Tables from './Tables';
const cols = [
{ key: 'StudentName', label: 'Students Name' },
{ key: 'Perusahaan', label: 'Perusahaan' },
{ key: 'Posisi', label: 'Posisi' },
{ key: 'Status', label: 'Status' },
];
const data = [
{ id: 1, StudentName: 'John Doe', Perusahaan: 'Jalanloka', Posisi: 'Software Engineer', Status: 'Melamar' },
{ id: 2, StudentName: 'Clark Kent', Perusahaan: 'Tutuplapak', Posisi: 'Data Scientist', Status: 'Diterima' },
{ id: 3, StudentName: 'Rosamund Pike', Perusahaan: 'Tutuplapak', Posisi: 'System Analyst', Status: 'Diterima' },
{ id: 4, StudentName: 'Melissa Benoist', Perusahaan: 'Blabla', Posisi: 'Data Scientist', Status: 'Melamar' },
];
export default class Applicants extends React.Component {
render() {
return (
<div className="home-dosen">
<Header as="h2">
<Icon name="list" />
<Header.Content>
Daftar Mahasiswa
</Header.Content>
</Header>
<Tables data={data} cols={cols} />
</div>
);
}
}
import React from 'react';
import { Table } from 'semantic-ui-react';
export default class Tables extends React.Component {
static propTypes = {
cols: React.PropTypes.any.isRequired,
data: React.PropTypes.any.isRequired,
};
generateHeaders() {
const cols2 = this.props.cols; // [{key, label}]
// generate our header (th) cell components
return cols2.map(colData => <Table.HeaderCell singleLine key={colData.key}> {colData.label} </Table.HeaderCell>
, error => error.then(() => ('Gagal mendapatkan informasi data')),
);
}
generateRows() {
const cols3 = this.props.cols; // [{key, label}]
const data2 = this.props.data;
return data2.map((item) => {
// handle the column data within each row
const cells = cols3.map(colData =>
// colData.key might be "firstName"
<Table.Cell> {item[colData.key]} </Table.Cell>);
return <Table.Row key={item.id}> {cells} </Table.Row>;
});
}
render() {
return (
<Table celled padded>
<Table.Header >
<Table.Row>
{this.generateHeaders()}
</Table.Row>
</Table.Header>
<Table.Body>{this.generateRows()}</Table.Body>
</Table>
);
}
}
Markdown is supported
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