From 0f015cadc7f10fafb336d90c9d5d65b21d039f50 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 11 Aug 2023 15:25:24 -0300 Subject: [PATCH 1/3] Fixed password required not showing --- .../src/components/inputComponent/index.tsx | 59 ++++++++++++++----- src/frontend/src/pages/signUpPage/index.tsx | 23 ++++---- src/frontend/src/types/components/index.ts | 2 + 3 files changed, 57 insertions(+), 27 deletions(-) diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 7adb029c3..5e3c5543c 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -1,3 +1,4 @@ +import * as Form from "@radix-ui/react-form"; import { useEffect, useState } from "react"; import { InputComponentType } from "../../types/components"; import { classNames } from "../../utils/utils"; @@ -7,6 +8,8 @@ export default function InputComponent({ value, onChange, disabled, + required = false, + isForm = false, password, editNode = false, placeholder = "Type something...", @@ -23,21 +26,47 @@ export default function InputComponent({ return (
- { - onChange(e.target.value); - }} - /> + {isForm ? ( + + { + onChange(e.target.value); + }} + /> + + ) : ( + { + onChange(e.target.value); + }} + /> + )} {password && (
- + Password * - - { - handleInput({ target: { name: "password", value } }); - }} - value={password} - password={true} - placeholder="Password" - className="w-full" - /> - + { + handleInput({ target: { name: "password", value } }); + }} + value={password} + isForm + password={true} + required + placeholder="Password" + className="w-full" + /> Please enter your password - - {password === "" && ( - - Please enter a valid password - - )}
diff --git a/src/frontend/src/pages/signUpPage/index.tsx b/src/frontend/src/pages/signUpPage/index.tsx index 5050d77e1..e2898885e 100644 --- a/src/frontend/src/pages/signUpPage/index.tsx +++ b/src/frontend/src/pages/signUpPage/index.tsx @@ -39,7 +39,7 @@ export default function SignUp(): JSX.Element {
⛓️ - Sign up to LangFlow + Sign up to Langflow
- - -
- or
diff --git a/src/frontend/src/pages/signUpPage/index.tsx b/src/frontend/src/pages/signUpPage/index.tsx index e2898885e..2f5e3f771 100644 --- a/src/frontend/src/pages/signUpPage/index.tsx +++ b/src/frontend/src/pages/signUpPage/index.tsx @@ -41,18 +41,6 @@ export default function SignUp(): JSX.Element { Sign up to Langflow -
- - - -
- or