import PropTypes from "prop-types"; import React from "react"; import Modal from "./Modal"; class TextInputModal extends React.Component { static propTypes = { title: PropTypes.string.isRequired, label: PropTypes.string.isRequired, show: PropTypes.bool.isRequired, callback: PropTypes.func.isRequired, initialValue: PropTypes.string, }; onSubmit() { this.props.callback(this.refs.textInput.value); this.refs.textInput.value = ""; } onCancel() { this.props.callback(undefined); this.refs.textInput.value = ""; } render() { return (
); } } export default TextInputModal;