import React from 'react'; import PropTypes from 'prop-types'; import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Input } from 'reactstrap'; import { gettext } from '../../../utils/constants'; const propTypes = { toggle: PropTypes.func.isRequired, addInstitution: PropTypes.func.isRequired }; class SysAdminAddInstitutionDialog extends React.Component { constructor(props) { super(props); this.state = { value: '', isSubmitBtnActive: false }; } handleChange = (e) => { const value = e.target.value; this.setState({ value: value, isSubmitBtnActive: value.trim() != '' }); } handleSubmit = () => { this.toggle(); this.props.addInstitution(this.state.value.trim()); } toggle = () => { this.props.toggle(); } render() { return ( {gettext('Add institution')}

{gettext('Name')}

); } } SysAdminAddInstitutionDialog.propTypes = propTypes; export default SysAdminAddInstitutionDialog;