diff --git a/src/components/Field.js b/src/components/Field.js new file mode 100644 index 00000000..1659c659 --- /dev/null +++ b/src/components/Field.js @@ -0,0 +1,23 @@ +import React from 'react'; +import './Field.css'; +import PropTypes from 'prop-types'; + +const Field = ({id, placeholder, value, onChangeCallback}) => { + return ( + 0 ? "" : "--invalid"}`} + id={id} + placeholder={placeholder} + type="text" + value={value} + onChange={onChangeCallback} /> + ); +} + +Field.propTypes = { + id: PropTypes.string.isRequired, + placeholder: PropTypes.string.isRequired, + value: PropTypes.string, + onChangeCallback: PropTypes.func.isRequired, +}; + +export default Field; \ No newline at end of file diff --git a/src/components/FinalPoem.js b/src/components/FinalPoem.js index d516184e..1ef567be 100644 --- a/src/components/FinalPoem.js +++ b/src/components/FinalPoem.js @@ -1,20 +1,28 @@ import React from 'react'; import './FinalPoem.css'; +import PropTypes from 'prop-types'; -const FinalPoem = (props) => { +const FinalPoem = ({isRevealed, poem, onButtonClickCallback}) => { return (
{line}
)} +