Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 46d74e3

Browse files
author
Manuel Proß
committed
feat(FE): add user registration page
1 parent 07d4677 commit 46d74e3

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

web/src/app/registration/page.tsx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
'use client';
2+
import { ChangeEvent, useState } from 'react';
3+
import Input from '@/components/Inputs/TextInput';
4+
5+
type RegistrationFormData = {
6+
username: string;
7+
firstname: string;
8+
lastname: string;
9+
email: string;
10+
password: string;
11+
passwordConfirm: string;
12+
};
13+
14+
export default function Registration() {
15+
const [formData, setFormData] = useState<RegistrationFormData>({
16+
username: '',
17+
firstname: '',
18+
lastname: '',
19+
email: '',
20+
password: '',
21+
passwordConfirm: '',
22+
});
23+
24+
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
25+
const { name, value } = e.target;
26+
setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
27+
};
28+
return (
29+
<form className="flex flex-col items-stretch gap-4">
30+
<Input
31+
type="text"
32+
label="Username"
33+
name="username"
34+
id="username"
35+
value={formData.username}
36+
onChange={handleInputChange}
37+
required
38+
/>
39+
<div className="flex justify-between gap-5">
40+
<div className="flex-2/3">
41+
<Input
42+
type="text"
43+
label="First Name"
44+
name="firstname"
45+
id="firstname"
46+
value={formData.firstname}
47+
onChange={handleInputChange}
48+
required
49+
/>
50+
</div>
51+
<div className="flex-1">
52+
<Input
53+
type="text"
54+
label="Last Name"
55+
name="lastname"
56+
id="lastname"
57+
value={formData.lastname}
58+
onChange={handleInputChange}
59+
required
60+
/>
61+
</div>
62+
</div>
63+
<Input
64+
type="text"
65+
label="Email Address"
66+
name="email"
67+
id="email"
68+
value={formData.email}
69+
onChange={handleInputChange}
70+
required
71+
/>
72+
<Input
73+
type="password"
74+
label="Password"
75+
name="password"
76+
id="password"
77+
value={formData.password}
78+
onChange={handleInputChange}
79+
required
80+
/>
81+
<Input
82+
type="password"
83+
label="Confirm Password"
84+
name="passwordConfirm"
85+
id="passwordConfirm"
86+
value={formData.passwordConfirm}
87+
onChange={handleInputChange}
88+
required
89+
/>
90+
<input className="ml-auto" type="submit" value="Register" />
91+
</form>
92+
);
93+
}

0 commit comments

Comments
 (0)