pull/84/head
jimmys-box 2 years ago
parent 935c30e57f
commit ac442d1113

@ -82,8 +82,8 @@ const CandidateField = ({avatar, label, description, candIndex, onDelete, onAdd,
setCreateObjectURL(URL.createObjectURL(i)); setCreateObjectURL(URL.createObjectURL(i));
} }
}; };
const test = {...inputProps};
console.log(test);
return ( return (
<Row className="rowNoMargin"> <Row className="rowNoMargin">
<div className={className}> <div className={className}>

@ -53,8 +53,7 @@ const CandidatesField = ({onChange}) => {
const removeCandidate = index => { const removeCandidate = index => {
if (candidates.length === 1) { if (candidates.length === 1) {
const newCandidates = [] const newCandidates = []
newCandidates.push({label: "", description: "", fieldRef: createRef()}); newCandidates.push({label: "", fieldRef: createRef()});
newCandidates.push({label: "", description: "", fieldRef: createRef()});
setCandidates(newCandidates); setCandidates(newCandidates);
onChange(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].label = label
candidates[index].description = description
setCandidates([...candidates]); setCandidates([...candidates]);
onChange(candidates); onChange(candidates);
}; };

@ -202,7 +202,7 @@ const CreateElection = (props) => {
} }
); );
}; };
const [visibled, setVisibility] = useState(false); const [visibled, setVisibility] = useState(false);
const [visibledGrades, setVisibilityGrades] = useState(false); const [visibledGrades, setVisibilityGrades] = useState(false);
const [visibledMails, setVisibilityMails] = useState(false); const [visibledMails, setVisibilityMails] = useState(false);
@ -240,7 +240,7 @@ const CreateElection = (props) => {
return; return;
} }
changeDisplay(); changeDisplay();
}; };
return ( return (
<Container className="addCandidatePage"> <Container className="addCandidatePage">
@ -491,7 +491,7 @@ const CreateElection = (props) => {
{badgesValues.map(f => ( {badgesValues.map(f => (
<Label className="numGrades numGradesMobile"> <Label className="numGrades numGradesMobile">
<Input type="radio" name="radio" value={f} checked={badgesValue === f} <Input type="radio" name="radio" value={f} checked={badgesValue === f}
onChange={e => setNumGrades(e.currentTarget.value)} /> onChange={e => setNumGrades(e.currentTarget.value)} />
<div className="customCheckmarck customCheckmarckMobile"><p>{f}</p></div> <div className="customCheckmarck customCheckmarckMobile"><p>{f}</p></div>
</Label> </Label>
@ -534,17 +534,14 @@ const CreateElection = (props) => {
</Col> </Col>
<Col xs="3"> <Col xs="3">
<div className="numGradesContainer justify-content-end" tabIndex={candidates.length + 3}> <div className="numGradesContainer justify-content-end" tabIndex={candidates.length + 3}>
{badgesValues.map(f => ( {badgesValues.map(f => (
<Label className="numGrades ">
<Input type="radio" name="radio" value={f} checked={badgesValue === f}
onChange={e => setNumGrades(e.currentTarget.value)} />
<div className="customCheckmarck"><p>{f}</p></div>
</Label>
))}
<Label className="numGrades ">
<Input type="radio" name="radio" value={f} checked={badgesValue === f}
onChange={e => setNumGrades(e.currentTarget.value)} />
<div className="customCheckmarck"><p>{f}</p></div>
</Label>
))}
</div> </div>
</Col> </Col>

Loading…
Cancel
Save