diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 1cd1e92..478ec8e 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -8,7 +8,7 @@ import usersService from "../../../services/UsersService"; import InputCom from "../../Helpers/Inputs/InputCom"; import AuthLayout from "../AuthLayout"; //import { GoogleOAuthProvider } from '@react-oauth/google'; -import { googleLogout, useGoogleLogin } from '@react-oauth/google'; +// import { googleLogout, useGoogleLogin } from '@react-oauth/google'; import { useDispatch } from "react-redux"; import { updateUserDetails } from "../../../store/UserDetails"; diff --git a/src/components/Helpers/Inputs/InputCom/index.jsx b/src/components/Helpers/Inputs/InputCom/index.jsx index 2fee6cf..4cabcd9 100644 --- a/src/components/Helpers/Inputs/InputCom/index.jsx +++ b/src/components/Helpers/Inputs/InputCom/index.jsx @@ -20,119 +20,28 @@ export default function InputCom({ disable, blurHandler, spanTag, - inputBg + inputBg, + direction }) { const inputRef = useRef(null); // Entry Validation // for Min Length: const minLengthValidation = () => { - if (inputRef && inputRef?.current && inputRef?.current?.name === "email") { - return 7; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "first_name" - ) { - return 3; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "last_name" - ) { - return 3; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "address" - ) { - return 5; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "password" - ) { - return 8; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "state" - ) { - return 3; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "province" - ) { - return 3; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "city" - ) { - return 3; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "amount" - ) { - return 1; - } + const inputConfig = inputConfigs[inputRef?.current?.name]?.minLength; + return inputConfig || 0; }; // for MaxLength const maxLengthValidation = () => { - if (inputRef && inputRef?.current && inputRef?.current?.name === "email") { - return 35; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "first_name" - ) { - return 25; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "last_name" - ) { - return 25; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "address" - ) { - return 49; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "password" - ) { - return 15; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "state" - ) { - return 25; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "province" - ) { - return 25; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "city" - ) { - return 25; - } else if ( - inputRef && - inputRef?.current && - inputRef?.current?.name === "amount" - ) { - return 9; - } + const inputConfig = inputConfigs[inputRef?.current?.name]?.maxLength; + return inputConfig || 30; }; + + // for Patterns + const inputPatterns = () => { + const inputConfig = inputConfigs[inputRef?.current?.name]?.pattern; + return inputConfig || "" + } return (
+
{props.errors.amount}
)} @@ -168,25 +172,31 @@ function TransferFund({ payment, wallet }) {+ {props.errors.recipientID} +
+ )} + + Add New + +- {props.errors.recipientID} -
- )}