fix: linting problems
This commit is contained in:
parent
8f572ed10c
commit
d21fa01ff2
|
@ -3,19 +3,17 @@
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
|
|
||||||
export default function play() {
|
export default function Play() {
|
||||||
const [grade, setGrade] = useState<number>(0);
|
const [grade, setGrade] = useState<number>(0);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
let voted;
|
|
||||||
const [password, setPassword] = useState<string | null>('');
|
const [password, setPassword] = useState<string | null>('');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const pass = localStorage.getItem('@password');
|
const pass = localStorage.getItem('@password');
|
||||||
setPassword(pass);
|
setPassword(pass);
|
||||||
voted = localStorage.getItem('@voted');
|
|
||||||
if (!pass) {
|
if (!pass) {
|
||||||
router.push('/');
|
router.push('/');
|
||||||
}
|
}
|
||||||
}, []);
|
}, [router]);
|
||||||
|
|
||||||
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -35,50 +33,45 @@ export default function play() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Calendrier-avant</h1>
|
<h1>Calendrier-avant</h1>
|
||||||
|
<div>
|
||||||
{voted ? (
|
<p>Cliquer sur la note à la fin de la présentation :</p>
|
||||||
<p>Vous avez déjà voté</p>
|
<form onSubmit={handleSubmit}>
|
||||||
) : (
|
<input type="radio" id="one" name="grade" checked={grade == 1} onChange={(e) => setGrade(1)}></input>
|
||||||
<div>
|
<label htmlFor="one">1</label>
|
||||||
<p>Cliquer sur la note à la fin de la présentation :</p>
|
<br></br>
|
||||||
<form onSubmit={handleSubmit}>
|
<input type="radio" id="15" name="grade" checked={grade == 1.5} onChange={(e) => setGrade(1.5)}></input>
|
||||||
<input type="radio" id="one" name="grade" checked={grade == 1} onChange={(e) => setGrade(1)}></input>
|
<label htmlFor="one">1.5</label>
|
||||||
<label htmlFor="one">1</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="2" name="grade" checked={grade == 2} onChange={(e) => setGrade(2)}></input>
|
||||||
<input type="radio" id="15" name="grade" checked={grade == 1.5} onChange={(e) => setGrade(1.5)}></input>
|
<label htmlFor="one">2</label>
|
||||||
<label htmlFor="one">1.5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="25" name="grade" checked={grade == 2.5} onChange={(e) => setGrade(2.5)}></input>
|
||||||
<input type="radio" id="2" name="grade" checked={grade == 2} onChange={(e) => setGrade(2)}></input>
|
<label htmlFor="one">2.5</label>
|
||||||
<label htmlFor="one">2</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="3" name="grade" checked={grade == 3} onChange={(e) => setGrade(3)}></input>
|
||||||
<input type="radio" id="25" name="grade" checked={grade == 2.5} onChange={(e) => setGrade(2.5)}></input>
|
<label htmlFor="one">3</label>
|
||||||
<label htmlFor="one">2.5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="35" name="grade" checked={grade == 3.5} onChange={(e) => setGrade(3.5)}></input>
|
||||||
<input type="radio" id="3" name="grade" checked={grade == 3} onChange={(e) => setGrade(3)}></input>
|
<label htmlFor="one">3.5</label>
|
||||||
<label htmlFor="one">3</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="4" name="grade" checked={grade == 4} onChange={(e) => setGrade(4)}></input>
|
||||||
<input type="radio" id="35" name="grade" checked={grade == 3.5} onChange={(e) => setGrade(3.5)}></input>
|
<label htmlFor="one">4</label>
|
||||||
<label htmlFor="one">3.5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="45" name="grade" checked={grade == 4.5} onChange={(e) => setGrade(4.5)}></input>
|
||||||
<input type="radio" id="4" name="grade" checked={grade == 4} onChange={(e) => setGrade(4)}></input>
|
<label htmlFor="one">4.5</label>
|
||||||
<label htmlFor="one">4</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="5" name="grade" checked={grade == 5} onChange={(e) => setGrade(5)}></input>
|
||||||
<input type="radio" id="45" name="grade" checked={grade == 4.5} onChange={(e) => setGrade(4.5)}></input>
|
<label htmlFor="one">5</label>
|
||||||
<label htmlFor="one">4.5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="55" name="grade" checked={grade == 5.5} onChange={(e) => setGrade(5.5)}></input>
|
||||||
<input type="radio" id="5" name="grade" checked={grade == 5} onChange={(e) => setGrade(5)}></input>
|
<label htmlFor="one">5.5</label>
|
||||||
<label htmlFor="one">5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="radio" id="6" name="grade" checked={grade == 6} onChange={(e) => setGrade(6)}></input>
|
||||||
<input type="radio" id="55" name="grade" checked={grade == 5.5} onChange={(e) => setGrade(5.5)}></input>
|
<label htmlFor="one">6</label>
|
||||||
<label htmlFor="one">5.5</label>
|
<br></br>
|
||||||
<br></br>
|
<input type="submit" value={'Envoyer'}></input>
|
||||||
<input type="radio" id="6" name="grade" checked={grade == 6} onChange={(e) => setGrade(6)}></input>
|
</form>
|
||||||
<label htmlFor="one">6</label>
|
</div>
|
||||||
<br></br>
|
|
||||||
<input type="submit" value={'Envoyer'}></input>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue