From d975006d926e1f5dff286d5914c70383e39ca08a Mon Sep 17 00:00:00 2001 From: Lvyshnevska Date: Thu, 9 May 2024 14:03:14 +0200 Subject: [PATCH] onblur, prop types --- .../FormComponents/FormFields/TextField.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/FrontEnd/src/components/ProfilePage/FormComponents/FormFields/TextField.js b/FrontEnd/src/components/ProfilePage/FormComponents/FormFields/TextField.js index 79378e8af..5c5814aee 100644 --- a/FrontEnd/src/components/ProfilePage/FormComponents/FormFields/TextField.js +++ b/FrontEnd/src/components/ProfilePage/FormComponents/FormFields/TextField.js @@ -1,3 +1,4 @@ +import { PropTypes } from 'prop-types'; import preventEnterSubmit from '../../../../utils/preventEnterSubmit'; import css from './TextField.module.css'; @@ -23,6 +24,7 @@ const TextField = (props) => { onKeyDown={preventEnterSubmit} required={(props.requredField) ? 'required' : ''} disabled={(props.name === 'email') ? 'disabled' : ''} + onBlur={props.onBlur} >
@@ -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, + }; \ No newline at end of file