Commit ebbd39a5 authored by Filipe Oliveira's avatar Filipe Oliveira
Browse files

refactor(Input): receive InputProps via props

parent ed990bdb
Showing with 12 additions and 1 deletion
+12 -1
......@@ -3,7 +3,15 @@ import { TextField } from '@material-ui/core';
import useStyles from './styles';
import PropTypes from 'prop-types';
function Input({ rows, multiline, variant, label, placeholder, ...others }) {
function Input({
rows,
multiline,
variant,
label,
placeholder,
InputProps,
...others
}) {
const classes = useStyles();
return (
......@@ -18,6 +26,7 @@ function Input({ rows, multiline, variant, label, placeholder, ...others }) {
classes,
className: classes.input,
disableUnderline: true,
...InputProps,
}}
{...others}
/>
......@@ -30,6 +39,7 @@ Input.propTypes = {
rows: PropTypes.number,
multiline: PropTypes.bool,
variant: PropTypes.string,
InputProps: PropTypes.object,
};
// Defina aqui o valor padrão de cada prop
......@@ -39,6 +49,7 @@ Input.defaultProps = {
multiline: false,
variant: 'filled',
placeholder: undefined,
InputProps: {},
};
export default Input;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment