Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
4d9db167
Commit
4d9db167
authored
Nov 03, 2022
by
Ibadullina Inabat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
убрала ненужные закомметированные куски кода
parent
236adc86
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
73 deletions
+2
-73
FileInput.js
planner-front/src/components/UI/Form/FileInput/FileInput.js
+0
-63
FormElement.js
...r-front/src/components/UI/Form/FormElement/FormElement.js
+1
-9
UserForm.js
planner-front/src/components/UserForm/UserForm.js
+1
-1
No files found.
planner-front/src/components/UI/Form/FileInput/FileInput.js
deleted
100644 → 0
View file @
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;
planner-front/src/components/UI/Form/FormElement/FormElement.js
View file @
4d9db167
import
{
Grid
,
TextField
,
MenuItem
}
from
"@mui/material"
;
import
{
Grid
,
TextField
,
MenuItem
}
from
"@mui/material"
;
import
PropTypes
from
"prop-types"
;
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
let
inputChildren
=
null
if
(
select
)
{
if
(
select
)
{
...
@@ -27,13 +26,6 @@ const FormElement = ({ name, label, state, error, onChange, select, options, mul
...
@@ -27,13 +26,6 @@ const FormElement = ({ name, label, state, error, onChange, select, options, mul
>
>
{
inputChildren
}
{
inputChildren
}
<
/TextField
>
<
/TextField
>
if
(
type
===
"file"
)
{
input
=
<
FileInput
name
=
{
name
}
label
=
{
label
}
onChange
=
{
onChange
}
/
>
}
return
<
Grid
item
xs
=
{
12
}
>
return
<
Grid
item
xs
=
{
12
}
>
{
input
}
{
input
}
<
/Grid
>
<
/Grid
>
...
...
planner-front/src/components/UserForm/UserForm.js
View file @
4d9db167
import
{
Button
,
Grid
}
from
"@mui/material"
;
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"
;
import
FormElement
from
"../UI/Form/FormElement/FormElement"
;
const
UserForm
=
({
state
,
onChange
,
onSubmit
,
getFieldError
,
buttonText
,
resetPassword
})
=>
{
const
UserForm
=
({
state
,
onChange
,
onSubmit
,
getFieldError
,
buttonText
,
resetPassword
})
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment