Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects

1606839334 166

Merged Juan Alexander Hamonangan requested to merge 1606839334-166 into master
3 files
+ 66
107
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -11,59 +11,10 @@ import {
@@ -11,59 +11,10 @@ import {
} from 'semantic-ui-react';
} from 'semantic-ui-react';
import ModalAlert from './../components/ModalAlert';
import ModalAlert from './../components/ModalAlert';
import Server from './../lib/Server';
import Server from './../lib/Server';
 
import GeneralModal from './GeneralModal';
export default class ApplyModal extends React.Component {
export default class ApplyModal extends GeneralModal {
static propTypes = {
data: PropTypes.object.isRequired,
active: PropTypes.bool.isRequired,
buttonTitle: PropTypes.string.isRequired,
resume: PropTypes.string,
studentId: PropTypes.number.isRequired,
updateStatus: PropTypes.func.isRequired,
};
constructor(props) {
super(props);
/* istanbul ignore next */
this.state = {
modalOpen: false,
coverLetter: '',
load: false,
};
this.handleChange = this.handleChange.bind(this);
this.handleOpen = this.handleOpen.bind(this);
this.handleApply = this.handleApply.bind(this);
}
componentWillUpdate() {
this.fixBody();
}
componentDidUpdate() {
this.fixBody();
}
fixBody = () => {
const anotherModal = document.getElementsByClassName('ui page modals')
.length;
if (anotherModal > 0)
document.body.classList.add('scrolling', 'dimmable', 'dimmed');
};
handleChange(event) {
this.setState({ coverLetter: event.target.value });
}
handleOpen() {
this.setState({ modalOpen: true });
}
handleClose = () =>
this.setState({
modalOpen: false,
load: false,
});
handleApply = () => {
handleApply = () => {
if (this.props.resume) {
if (this.props.resume) {
this.setState({ load: true });
this.setState({ load: true });
Loading