Refactor[UserManagementModal]: Refactor admin user sign to use password input component
This commit is contained in:
parent
019e34190a
commit
e705f5bdf4
1 changed files with 24 additions and 20 deletions
|
|
@ -4,6 +4,7 @@ import { Button } from "../../components/ui/button";
|
||||||
import { UserManagementType } from "../../types/components";
|
import { UserManagementType } from "../../types/components";
|
||||||
import { nodeIconsLucide } from "../../utils/styleUtils";
|
import { nodeIconsLucide } from "../../utils/styleUtils";
|
||||||
import BaseModal from "../baseModal";
|
import BaseModal from "../baseModal";
|
||||||
|
import InputComponent from "../../components/inputComponent";
|
||||||
|
|
||||||
export default function UserManagementModal({
|
export default function UserManagementModal({
|
||||||
title,
|
title,
|
||||||
|
|
@ -84,6 +85,7 @@ export default function UserManagementModal({
|
||||||
value={username}
|
value={username}
|
||||||
className="primary-input"
|
className="primary-input"
|
||||||
required
|
required
|
||||||
|
placeholder="Username"
|
||||||
/>
|
/>
|
||||||
</Form.Control>
|
</Form.Control>
|
||||||
<Form.Message match="valueMissing" className="field-invalid">
|
<Form.Message match="valueMissing" className="field-invalid">
|
||||||
|
|
@ -109,16 +111,17 @@ export default function UserManagementModal({
|
||||||
<span className="font-medium text-destructive">*</span>
|
<span className="font-medium text-destructive">*</span>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
</div>
|
</div>
|
||||||
<Form.Control asChild>
|
<InputComponent
|
||||||
<input
|
|
||||||
onChange={(input) => {
|
onChange={(input) => {
|
||||||
setPassword(input.target.value);
|
setPassword(input);
|
||||||
}}
|
}}
|
||||||
value={password}
|
value={password}
|
||||||
|
password={true}
|
||||||
|
isForm
|
||||||
className="primary-input"
|
className="primary-input"
|
||||||
required
|
required
|
||||||
|
placeholder="Password"
|
||||||
/>
|
/>
|
||||||
</Form.Control>
|
|
||||||
<Form.Message className="field-invalid" match="valueMissing">
|
<Form.Message className="field-invalid" match="valueMissing">
|
||||||
Please enter a password
|
Please enter a password
|
||||||
</Form.Message>
|
</Form.Message>
|
||||||
|
|
@ -148,16 +151,17 @@ export default function UserManagementModal({
|
||||||
<span className="font-medium text-destructive">*</span>
|
<span className="font-medium text-destructive">*</span>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
</div>
|
</div>
|
||||||
<Form.Control asChild>
|
<InputComponent
|
||||||
<input
|
|
||||||
onChange={(input) => {
|
onChange={(input) => {
|
||||||
setConfirmPassword(input.target.value);
|
setConfirmPassword(input);
|
||||||
}}
|
}}
|
||||||
value={confirmPassword}
|
value={confirmPassword}
|
||||||
|
password={true}
|
||||||
|
isForm
|
||||||
className="primary-input"
|
className="primary-input"
|
||||||
required
|
required
|
||||||
|
placeholder="Confirm your password"
|
||||||
/>
|
/>
|
||||||
</Form.Control>
|
|
||||||
<Form.Message className="field-invalid" match="valueMissing">
|
<Form.Message className="field-invalid" match="valueMissing">
|
||||||
Please confirm your password
|
Please confirm your password
|
||||||
</Form.Message>
|
</Form.Message>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue