From e0c78373fb4440e77d09274c9a6e4b4478b3b6e3 Mon Sep 17 00:00:00 2001 From: yuri alves Date: Wed, 25 Oct 2023 15:01:56 -0300 Subject: [PATCH] :bug: fix some code smell --- .eslintrc.js | 1 - src/components/Input.js | 31 ++++++++++++++++++++----------- src/pages/ChangePassword.js | 4 +--- src/pages/QuemSomos.js | 1 - 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7e9aa0a7..43f3da48 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,7 +15,6 @@ module.exports = { 'import', ], rules: { - "react/prop-types": "off" }, }; \ No newline at end of file diff --git a/src/components/Input.js b/src/components/Input.js index d4b106d5..d5a47965 100644 --- a/src/components/Input.js +++ b/src/components/Input.js @@ -1,14 +1,23 @@ -import React from "react"; -import "../style/components/input.css" +import React from 'react'; +import PropTypes from 'prop-types'; +import '../style/components/input.css'; -export default function Input(props) { - return ( -
- - -
- ); +function Input(props) { + return ( +
+ + +
+ ); } +Input.propTypes = { + label: PropTypes.string, + placeholder: PropTypes.string, + className: PropTypes.string, + onChange: PropTypes.func, +}; + +export default Input; diff --git a/src/pages/ChangePassword.js b/src/pages/ChangePassword.js index 766d8ea6..d4ce575d 100644 --- a/src/pages/ChangePassword.js +++ b/src/pages/ChangePassword.js @@ -1,9 +1,7 @@ -import React from "react"; +import React,{ useState } from "react"; import '../style/pages/changePassword.css'; import ChangePasswordPeople from '../assets/change-password-people.svg'; import elipse6 from '../assets/elipse6.svg'; - -import { useState } from 'react'; import { changePassword } from "../api/api"; export default function ChangePassword() { diff --git a/src/pages/QuemSomos.js b/src/pages/QuemSomos.js index 5c25685b..71ea183e 100644 --- a/src/pages/QuemSomos.js +++ b/src/pages/QuemSomos.js @@ -1,6 +1,5 @@ import React from 'react'; import '../style/pages/quemSomos.css'; -//import pessoasDois from '../assets/pessoasDois.svg'; import PoliciaCivilLogo from '../assets/PoliciaCivilLogo.svg'; import elipse from '../assets/home_elipse.svg';