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