|
@@ -7,8 +7,13 @@ const LoginForm = () => {
|
|
const [password, setPassword] = useState("");
|
|
const [password, setPassword] = useState("");
|
|
|
|
|
|
const onLogin = () => {
|
|
const onLogin = () => {
|
|
- return !(login !== "" && password.match(/\w{8,30}$/));
|
|
|
|
|
|
+ return !(login !== "" && password.match(/\w{8,30}$/))
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ const Authorization = () => {
|
|
|
|
+ return alert("Welcome, authorization was successful")
|
|
|
|
+ }
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className="formBlock">
|
|
<div className="formBlock">
|
|
<p>Enter login:</p>
|
|
<p>Enter login:</p>
|
|
@@ -24,7 +29,7 @@ const LoginForm = () => {
|
|
value={password}
|
|
value={password}
|
|
onChange={(e) => setPassword(e.target.value)}
|
|
onChange={(e) => setPassword(e.target.value)}
|
|
/>
|
|
/>
|
|
- <button disabled={onLogin()}>Log In</button>
|
|
|
|
|
|
+ <button disabled={onLogin()} onClick = {Authorization}>Log In</button>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
};
|
|
};
|