1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
import React from "react";
import InputPanel, { InputPanelError } from "../common/input/InputPanel";
const RegisterPage: React.FC = () => {
const [username, setUsername] = React.useState<string>("");
const [password, setPassword] = React.useState<string>("");
const [confirmPassword, setConfirmPassword] = React.useState<string>("");
const [registerCode, setRegisterCode] = React.useState<string>("");
const [error, setError] = React.useState<InputPanelError>();
return (
<div>
<InputPanel
scheme={[
{
type: "text",
label: "register.username",
},
{
type: "text",
label: "register.password",
password: true,
},
{
type: "text",
label: "register.confirmPassword",
password: true,
},
{ type: "text", label: "register.registerCode" },
]}
values={[username, password, confirmPassword, registerCode]}
onChange={(values) => {
setUsername(values[0]);
setPassword(values[1]);
setConfirmPassword(values[2]);
setRegisterCode(values[3]);
}}
error={error}
/>
</div>
);
};
export default RegisterPage;
|