Fakultas Ilmu Komputer UI

Commit aa45d048 authored by PRIAMBUDI LINTANG BAGASKARA's avatar PRIAMBUDI LINTANG BAGASKARA 🎱
Browse files

1606895171 177

parent e1054624
import React from 'react';
import PropTypes from 'prop-types';
import { Segment, Header, Image, Container, Form, Button, Icon, TextArea } from 'semantic-ui-react';
import {
Segment, Header, Image, Container, Form, Button, Icon, TextArea,
} from 'semantic-ui-react';
import { Doughnut } from 'react-chartjs-2';
import Server from './lib/Server';
import Dumper from './lib/Dumper';
......@@ -8,8 +10,6 @@ import ModalAlert from './components/ModalAlert';
export default class CompanyProfile extends React.Component {
static propTypes = {
route: PropTypes.object.isRequired,
params: PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
};
......@@ -41,17 +41,6 @@ export default class CompanyProfile extends React.Component {
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
Server.get(
`/companies/${this.props.user.data.company.id}/vacancies/`,
false,
).then((result) => {
this.setState({ vacancies: result.results });
},
(error) => error.then(() => {
console.log(error);
}),
);
Server.get(
`/companies/${this.props.user.data.company.id}/applications/`,
false,
......@@ -60,8 +49,7 @@ export default class CompanyProfile extends React.Component {
},
(error) => error.then(() => {
console.log(error);
}),
);
}));
}
getProfile() {
......
......@@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
Segment,
Image,
Header,
Icon,
Checkbox,
......@@ -13,7 +12,7 @@ import Server from './lib/Server';
import Storage from './lib/Storage';
import ModalAlert from './components/ModalAlert';
import Dumper from './lib/Dumper';
import { isFromGithubLinkValid, gotoLink } from './Utils';
import { isFromGithubLinkValid } from './Utils';
export default class EditProfile extends React.Component {
static propTypes = {
......@@ -27,26 +26,14 @@ export default class EditProfile extends React.Component {
/* istanbul ignore next */
this.state = {
id: '',
npm: '',
name: '',
major: '',
batch: '',
email: '',
gender: '',
region: '',
alamat: '',
cityOfBirth: '',
dateOfBirth: '',
resume: '',
phone_number: '',
portfolio_link: '',
show_transcript: '',
photo: '',
age: '',
intro: '',
expected_salary: '',
job_seeking_status: '',
volunteer: '',
skills: '',
form: {
picture: '',
......@@ -72,14 +59,10 @@ export default class EditProfile extends React.Component {
seminar: '',
interests: '',
},
bagikanTranskrip: '',
acceptedNo: 0,
readNo: 0,
refresh: 1,
loading: false,
linkedin_url: '',
hackerrank_url: '',
self_description: '',
student_gpa: 0.0,
website_url: '',
latest_work: '',
......@@ -110,32 +93,16 @@ export default class EditProfile extends React.Component {
this.setState({
id: data.id,
name: data.full_name,
npm: data.npm,
resume: data.resume,
major: data.major,
batch: data.batch,
email: data.user.email,
gender: data.gender,
region: data.region,
alamat: data.alamat,
cityOfBirth: data.birth_place,
dateOfBirth: this.parseIndonesianDateFormat(data.birth_date),
phone_number: data.phone_number,
portfolio_link: data.portfolio_link,
photo: data.photo,
show_transcript: data.show_transcript,
acceptedNo: data.accepted_no,
readNo: data.read_no,
bagikanTranskrip: data.show_transcript,
refresh: this.state.refresh + 1,
age: data.age,
intro: data.intro,
expected_salary: data.expected_salary,
job_seeking_status: data.job_seeking_status,
volunteer: data.volunteer,
linkedin_url: data.linkedin_url,
hackerrank_url: data.hackerrank_url,
self_description: data.self_description,
student_gpa: data.student_gpa,
website_url: data.website_url,
latest_work: data.latest_work,
......
import React from 'react';
import {ModalComponent} from "./ModalComponent";
import { ModalComponent } from './ModalComponent';
export default class ModalAlert extends React.Component {
constructor(props) {
......@@ -37,7 +37,9 @@ export default class ModalAlert extends React.Component {
};
close = () => {
this.setState({ open: false });
this.setState({
open: false,
});
this.state.callback();
};
......@@ -46,7 +48,7 @@ export default class ModalAlert extends React.Component {
return (
<ModalComponent
open={this.state.open}
icon={"warning sign"}
icon="warning sign"
header={this.state.header}
style={style}
content={this.state.content}
......
import React from 'react';
import {ModalComponent} from "./ModalComponent";
import { ModalComponent } from './ModalComponent';
export default class ModalSuccess extends React.Component {
constructor(props) {
......@@ -25,7 +25,11 @@ export default class ModalSuccess extends React.Component {
if (anotherModal > 0) document.body.classList.add('scrolling', 'dimmable', 'dimmed');
};
open = (header = this.state.header, content = this.state.content, callback = this.state.callback) => {
open = (
header = this.state.header,
content = this.state.content,
callback = this.state.callback,
) => {
this.setState({
open: true,
header,
......@@ -44,7 +48,7 @@ export default class ModalSuccess extends React.Component {
return (
<ModalComponent
open={this.state.open}
icon={"checkmark sign"}
icon="checkmark sign"
header={this.state.header}
style={style}
content={this.state.content}
......
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