Commit 4d9db167 authored by Ibadullina Inabat's avatar Ibadullina Inabat

убрала ненужные закомметированные куски кода

parent 236adc86
// import {useRef, useState} from "react";
// import {Button, Grid, TextField} from "@mui/material";
// const FileInput = ({onChange, name, label}) => {
// const [filename, setFilename] = useState("");
// const inputRef = useRef();
// const activateInput = () => {
// inputRef.current.click();
// };
// const onFileChange = (e) => {
// const file = e.target.files[0];
// if (file) {
// setFilename(file.name);
// } else {
// setFilename("");
// }
// onChange(e);
// };
// return (
// <>
// <input
// type="file"
// name={name}
// ref={inputRef}
// style={{display: "none"}}
// onChange={onFileChange}
// accept="image/png, image/jpeg"
// />
// <Grid
// container
// direction="row"
// spacing={2}
// alignItems="center"
// >
// <Grid item xs>
// <TextField
// variant="standard"
// disabled
// fullWidth
// label={label}
// value={filename}
// onClick={activateInput}
// />
// </Grid>
// <Grid item>
// <Button
// variant="contained"
// onClick={activateInput}
// >
// Browse
// </Button>
// </Grid>
// </Grid>
// </>
// );
// };
// export default FileInput;
import { Grid, TextField, MenuItem } from "@mui/material";
import PropTypes from "prop-types";
import FileInput from "../FileInput/FileInput";
const FormElement = ({ name, label, state, error, onChange, select, options, multiline, rows, type = "'text" }) => {
const FormElement = ({ name, label, state, error, onChange, select, options, type = "'text" }) => {
let inputChildren = null
if (select) {
......@@ -27,13 +26,6 @@ const FormElement = ({ name, label, state, error, onChange, select, options, mul
>
{inputChildren}
</TextField>
if (type === "file") {
input = <FileInput
name={name}
label={label}
onChange={onChange}
/>
}
return <Grid item xs={12}>
{input}
</Grid>
......
import { Button, Grid} from "@mui/material";
import { NavLink } from "react-router-dom";
// import { NavLink } from "react-router-dom";
import FormElement from "../UI/Form/FormElement/FormElement";
const UserForm = ({ state, onChange, onSubmit, getFieldError, buttonText, resetPassword }) => {
......
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