Skip to content

Commit

Permalink
onblur, prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvyshnevska committed May 9, 2024
1 parent 9a40898 commit d975006
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PropTypes } from 'prop-types';
import preventEnterSubmit from '../../../../utils/preventEnterSubmit';
import css from './TextField.module.css';

Expand All @@ -23,6 +24,7 @@ const TextField = (props) => {
onKeyDown={preventEnterSubmit}
required={(props.requredField) ? 'required' : ''}
disabled={(props.name === 'email') ? 'disabled' : ''}
onBlur={props.onBlur}
></textarea>
</div>
<div className={css['count__symbols']}>
Expand All @@ -38,3 +40,15 @@ const TextField = (props) => {
};

export default TextField;

TextField.propTypes = {
requredField: PropTypes.bool,
label: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
value: PropTypes.string,
fieldPlaceholder: PropTypes.string,
maxLength: PropTypes.number,
updateHandler: PropTypes.func,
error: PropTypes.string,
onBlur: PropTypes.func,
};

0 comments on commit d975006

Please sign in to comment.