refactor: Add adjusts to make confirm password error work
This commit is contained in:
parent
0f015cadc7
commit
3e83540eab
2 changed files with 25 additions and 29 deletions
|
|
@ -39,7 +39,7 @@ export default function LoginPage(): JSX.Element {
|
||||||
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
||||||
<span className="mb-4 text-5xl">⛓️</span>
|
<span className="mb-4 text-5xl">⛓️</span>
|
||||||
<span className="mb-6 text-2xl font-semibold text-primary">
|
<span className="mb-6 text-2xl font-semibold text-primary">
|
||||||
Sign in to LangFlow
|
Sign in to Langflow
|
||||||
</span>
|
</span>
|
||||||
<div className="flex w-full items-center justify-center gap-2">
|
<div className="flex w-full items-center justify-center gap-2">
|
||||||
<Button variant="primary" className="w-full py-6">
|
<Button variant="primary" className="w-full py-6">
|
||||||
|
|
@ -77,32 +77,26 @@ export default function LoginPage(): JSX.Element {
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-3 w-full">
|
<div className="mb-3 w-full">
|
||||||
<Form.Field name="password" serverInvalid={password === ""}>
|
<Form.Field name="password">
|
||||||
<Form.Label className="data-[invalid]:label-invalid">
|
<Form.Label className="data-[invalid]:label-invalid">
|
||||||
Password <span className="font-medium text-destructive">*</span>
|
Password <span className="font-medium text-destructive">*</span>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
|
|
||||||
<Form.Control asChild>
|
|
||||||
<InputComponent
|
<InputComponent
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
handleInput({ target: { name: "password", value } });
|
handleInput({ target: { name: "password", value } });
|
||||||
}}
|
}}
|
||||||
value={password}
|
value={password}
|
||||||
|
isForm
|
||||||
password={true}
|
password={true}
|
||||||
|
required
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
className="w-full"
|
className="w-full"
|
||||||
/>
|
/>
|
||||||
</Form.Control>
|
|
||||||
|
|
||||||
<Form.Message className="field-invalid" match="valueMissing">
|
<Form.Message className="field-invalid" match="valueMissing">
|
||||||
Please enter your password
|
Please enter your password
|
||||||
</Form.Message>
|
</Form.Message>
|
||||||
|
|
||||||
{password === "" && (
|
|
||||||
<Form.Message className="field-invalid">
|
|
||||||
Please enter a valid password
|
|
||||||
</Form.Message>
|
|
||||||
)}
|
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export default function SignUp(): JSX.Element {
|
||||||
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
||||||
<span className="mb-4 text-5xl">⛓️</span>
|
<span className="mb-4 text-5xl">⛓️</span>
|
||||||
<span className="mb-6 text-2xl font-semibold text-primary">
|
<span className="mb-6 text-2xl font-semibold text-primary">
|
||||||
Sign up to LangFlow
|
Sign up to Langflow
|
||||||
</span>
|
</span>
|
||||||
<div className="flex w-full items-center justify-center gap-2">
|
<div className="flex w-full items-center justify-center gap-2">
|
||||||
<Button variant="primary" className="w-full py-6">
|
<Button variant="primary" className="w-full py-6">
|
||||||
|
|
@ -114,15 +114,17 @@ export default function SignUp(): JSX.Element {
|
||||||
<span className="font-medium text-destructive">*</span>
|
<span className="font-medium text-destructive">*</span>
|
||||||
</Form.Label>
|
</Form.Label>
|
||||||
|
|
||||||
<Form.Control asChild>
|
|
||||||
<InputComponent
|
<InputComponent
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
handleInput({ target: { name: "cnfPassword", value } });
|
handleInput({ target: { name: "cnfPassword", value } });
|
||||||
}}
|
}}
|
||||||
value={cnfPassword}
|
value={cnfPassword}
|
||||||
|
isForm
|
||||||
password={true}
|
password={true}
|
||||||
|
required
|
||||||
|
placeholder="Confirm your password"
|
||||||
|
className="w-full"
|
||||||
/>
|
/>
|
||||||
</Form.Control>
|
|
||||||
|
|
||||||
<Form.Message className="field-invalid" match="valueMissing">
|
<Form.Message className="field-invalid" match="valueMissing">
|
||||||
Please confirm your password
|
Please confirm your password
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue