mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-04 22:13:21 +00:00
fix(frontend): use useId() for input IDs
This commit is contained in:
@@ -4,6 +4,12 @@ import { useAuth } from "../contexts/AuthContext";
|
|||||||
|
|
||||||
const FirstTimeAdminSetup = () => {
|
const FirstTimeAdminSetup = () => {
|
||||||
const { login } = useAuth();
|
const { login } = useAuth();
|
||||||
|
const firstNameId = useId();
|
||||||
|
const lastNameId = useId();
|
||||||
|
const usernameId = useId();
|
||||||
|
const emailId = useId();
|
||||||
|
const passwordId = useId();
|
||||||
|
const confirmPasswordId = useId();
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
username: "",
|
username: "",
|
||||||
email: "",
|
email: "",
|
||||||
@@ -163,14 +169,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="firstName"
|
htmlFor={firstNameId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
First Name
|
First Name
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="firstName"
|
id={firstNameId}
|
||||||
name="firstName"
|
name="firstName"
|
||||||
value={formData.firstName}
|
value={formData.firstName}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
@@ -182,14 +188,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="lastName"
|
htmlFor={lastNameId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
Last Name
|
Last Name
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="lastName"
|
id={lastNameId}
|
||||||
name="lastName"
|
name="lastName"
|
||||||
value={formData.lastName}
|
value={formData.lastName}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
@@ -203,14 +209,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="username"
|
htmlFor={usernameId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
Username
|
Username
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="username"
|
id={usernameId}
|
||||||
name="username"
|
name="username"
|
||||||
value={formData.username}
|
value={formData.username}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
@@ -223,14 +229,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="email"
|
htmlFor={emailId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
Email Address
|
Email Address
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
id="email"
|
id={emailId}
|
||||||
name="email"
|
name="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
@@ -243,14 +249,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="password"
|
htmlFor={passwordId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
Password
|
Password
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
id="password"
|
id={passwordId}
|
||||||
name="password"
|
name="password"
|
||||||
value={formData.password}
|
value={formData.password}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
@@ -263,14 +269,14 @@ const FirstTimeAdminSetup = () => {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
htmlFor="confirmPassword"
|
htmlFor={confirmPasswordId}
|
||||||
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
className="block text-sm font-medium text-secondary-700 dark:text-secondary-300 mb-2"
|
||||||
>
|
>
|
||||||
Confirm Password
|
Confirm Password
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
id="confirmPassword"
|
id={confirmPasswordId}
|
||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
value={formData.confirmPassword}
|
value={formData.confirmPassword}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user