Fakultas Ilmu Komputer UI

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

[#140654507] #13 add VacancyList component

parent f9a7be2d
......@@ -4,7 +4,7 @@ import ReactTestUtils from 'react-addons-test-utils';
import VacancyList from '../../components/VacancyList';
import ModalPendaftaran from '../../components/ModalPendaftaran';
describe('LoginForm', () => {
describe('VacancyList', () => {
it('created without problem', () => {
const vacancyList = new VacancyList();
expect(vacancyList).to.be.an.instanceof(VacancyList);
......@@ -15,7 +15,7 @@ describe('LoginForm', () => {
<VacancyList header="header" content="content" buttonTitle="submit" />);
expect(vacancyList).to.exist;
React.Children.forEach(this.props.children, (child) => {
React.Children.forEach(vacancyList.props.children, (child) => {
expect(child).to.be.an.instanceof(ModalPendaftaran);
});
});
......
import React from 'react';
import { Button, Image as ImageComponent, Item } from 'semantic-ui-react'
import { Button, Image as ImageComponent, Item } from 'semantic-ui-react';
import ModalPendaftaran from './ModalPendaftaran';
//const paragraph = <ImageComponent src="http://semantic-ui.com/images/wireframe/short-paragraph.png" />;
// const paragraph = <ImageComponent src="http://semantic-ui.com/images/wireframe/short-paragraph.png" />;
export default class Lowongan extends React.Component{
static propTypes = {
header: React.PropTypes.oneOfType([
React.PropTypes.node,
React.PropTypes.string,
]).isRequired,
content: React.PropTypes.oneOfType([
React.PropTypes.node,
React.PropTypes.string,
]).isRequired,
image: React.PropTypes.oneOfType([
React.PropTypes.node,
React.PropTypes.string,
]).isRequired,
paragraph: React.PropTypes.string.isRequired
export default class Lowongan extends React.Component {
static propTypes = {
data: React.PropTypes.object.isRequired,
};
render(){
return(
render() {
return (
<Item.Group relaxed>
<Item>
{this.props.image}
<Item.Content verticalAlign="middle">
<Item.Header>{this.props.header}</Item.Header>
<Item.Description>{this.props.content}</Item.Description>
<Item.Extra>
<div className="daftar">
<ModalPendaftaran content={this.props.paragraph} header="Pendaftaran Lowongan" buttontTitle="Daftar" />
</div>
</Item.Extra>
</Item.Content>
</Item>
</Item.Group>
);
}
}
\ No newline at end of file
<Item.Group relaxed>
<Item>
{this.props.image}
<Item.Content verticalAlign="middle">
<Item.Header>{this.props.header}</Item.Header>
<Item.Description>{this.props.content}</Item.Description>
<Item.Extra>
<div className="daftar">
<ModalPendaftaran content={{ tes: 'dor' }} header="Pendaftaran Lowongan" buttontTitle="Daftar" />
</div>
</Item.Extra>
</Item.Content>
</Item>
</Item.Group>
);
}
}
import React from 'react';
import Lowongan from './Lowongan';
export default class VacancyList extends React.Component {
static propTypes = {
vacancies: React.PropTypes.array
};
static defaultProps = {
vacancies: [],
};
generateVacancies(){
return(
this.props.vacancies.map((vacancyData) =>
<Lowongan data={vacancyData}/>)
);
}
render = () => (
<div className="vscancyList" >{ this.generateVacancies() }
</div>
)
}
\ No newline at end of file
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