diff --git a/components/form/CandidateField.jsx b/components/form/CandidateField.jsx index 4f7e52a..9dc42cd 100644 --- a/components/form/CandidateField.jsx +++ b/components/form/CandidateField.jsx @@ -82,8 +82,8 @@ const CandidateField = ({avatar, label, description, candIndex, onDelete, onAdd, setCreateObjectURL(URL.createObjectURL(i)); } }; - - +const test = {...inputProps}; +console.log(test); return (
diff --git a/components/form/CandidatesField.jsx b/components/form/CandidatesField.jsx index 8e96b13..07c577c 100644 --- a/components/form/CandidatesField.jsx +++ b/components/form/CandidatesField.jsx @@ -53,8 +53,7 @@ const CandidatesField = ({onChange}) => { const removeCandidate = index => { if (candidates.length === 1) { const newCandidates = [] - newCandidates.push({label: "", description: "", fieldRef: createRef()}); - newCandidates.push({label: "", description: "", fieldRef: createRef()}); + newCandidates.push({label: "", fieldRef: createRef()}); setCandidates(newCandidates); onChange(newCandidates) } @@ -65,9 +64,8 @@ const CandidatesField = ({onChange}) => { } }; - const editCandidate = (index, label, description) => { + const editCandidate = (index, label) => { candidates[index].label = label - candidates[index].description = description setCandidates([...candidates]); onChange(candidates); }; diff --git a/pages/new/index.js b/pages/new/index.js index b24ca2e..9398312 100644 --- a/pages/new/index.js +++ b/pages/new/index.js @@ -202,7 +202,7 @@ const CreateElection = (props) => { } ); }; - + const [visibled, setVisibility] = useState(false); const [visibledGrades, setVisibilityGrades] = useState(false); const [visibledMails, setVisibilityMails] = useState(false); @@ -240,7 +240,7 @@ const CreateElection = (props) => { return; } changeDisplay(); - + }; return ( @@ -491,7 +491,7 @@ const CreateElection = (props) => { {badgesValues.map(f => ( @@ -534,17 +534,14 @@ const CreateElection = (props) => {
- {badgesValues.map(f => ( - - -))} - - + {badgesValues.map(f => ( + + ))}