refactor: Add adjusts to make confirm password error work

This commit is contained in:
igorrCarvalho 2023-08-11 16:21:01 -03:00
commit 3e83540eab
2 changed files with 25 additions and 29 deletions

View file

@ -39,7 +39,7 @@ export default function LoginPage(): JSX.Element {
<div className="flex w-72 flex-col items-center justify-center gap-2">
<span className="mb-4 text-5xl"></span>
<span className="mb-6 text-2xl font-semibold text-primary">
Sign in to LangFlow
Sign in to Langflow
</span>
<div className="flex w-full items-center justify-center gap-2">
<Button variant="primary" className="w-full py-6">
@ -77,32 +77,26 @@ export default function LoginPage(): JSX.Element {
</Form.Field>
</div>
<div className="mb-3 w-full">
<Form.Field name="password" serverInvalid={password === ""}>
<Form.Field name="password">
<Form.Label className="data-[invalid]:label-invalid">
Password <span className="font-medium text-destructive">*</span>
</Form.Label>
<Form.Control asChild>
<InputComponent
onChange={(value) => {
handleInput({ target: { name: "password", value } });
}}
value={password}
password={true}
placeholder="Password"
className="w-full"
/>
</Form.Control>
<InputComponent
onChange={(value) => {
handleInput({ target: { name: "password", value } });
}}
value={password}
isForm
password={true}
required
placeholder="Password"
className="w-full"
/>
<Form.Message className="field-invalid" match="valueMissing">
Please enter your password
</Form.Message>
{password === "" && (
<Form.Message className="field-invalid">
Please enter a valid password
</Form.Message>
)}
</Form.Field>
</div>
<div className="w-full">

View file

@ -39,7 +39,7 @@ export default function SignUp(): JSX.Element {
<div className="flex w-72 flex-col items-center justify-center gap-2">
<span className="mb-4 text-5xl"></span>
<span className="mb-6 text-2xl font-semibold text-primary">
Sign up to LangFlow
Sign up to Langflow
</span>
<div className="flex w-full items-center justify-center gap-2">
<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>
</Form.Label>
<Form.Control asChild>
<InputComponent
onChange={(value) => {
handleInput({ target: { name: "cnfPassword", value } });
}}
value={cnfPassword}
password={true}
/>
</Form.Control>
<InputComponent
onChange={(value) => {
handleInput({ target: { name: "cnfPassword", value } });
}}
value={cnfPassword}
isForm
password={true}
required
placeholder="Confirm your password"
className="w-full"
/>
<Form.Message className="field-invalid" match="valueMissing">
Please confirm your password