fix: text
This commit is contained in:
parent
ff44beb61b
commit
a1fb215aa4
14
app/page.tsx
14
app/page.tsx
|
@ -1,12 +1,18 @@
|
|||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
export default function Home() {
|
||||
const [password, setPassword] = useState('');
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (localStorage.getItem('@password')) {
|
||||
router.push('/play');
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
||||
event.preventDefault();
|
||||
|
||||
|
@ -15,9 +21,9 @@ export default function Home() {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className={""}>
|
||||
<h1 className={"border-l-blue-600"}>Calendrier-avent</h1>
|
||||
<p>Please enter the password :</p>
|
||||
<div className={''}>
|
||||
<h1 className={'border-l-blue-600'}>Calendrier-avent</h1>
|
||||
<p>Merci d'entrer votre clé :</p>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<input type="password" id="password" name="password" value={password} onChange={(e) => setPassword(e.target.value)}></input>
|
||||
<input type="submit" value="Submit"></input>
|
||||
|
|
Loading…
Reference in New Issue