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,10 +33,6 @@ export default function play() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>Calendrier-avant</h1>
|
<h1>Calendrier-avant</h1>
|
||||||
|
|
||||||
{voted ? (
|
|
||||||
<p>Vous avez déjà voté</p>
|
|
||||||
) : (
|
|
||||||
<div>
|
<div>
|
||||||
<p>Cliquer sur la note à la fin de la présentation :</p>
|
<p>Cliquer sur la note à la fin de la présentation :</p>
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
|
@ -78,7 +72,6 @@ export default function play() {
|
||||||
<input type="submit" value={'Envoyer'}></input>
|
<input type="submit" value={'Envoyer'}></input>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue