Compare commits

...

5 Commits

Author SHA1 Message Date
victorAnumudu d5e66618aa added limit to card and account adding 2023-09-18 20:46:17 +01:00
CHIEFSOFT\ameye 2e89f07ee2 env add 2023-09-18 12:17:54 -04:00
ameye 9db7f5c985 Merge branch 'signup-page-pathname-fix' of WrenchBoard/Users-Wrench into master 2023-09-13 06:21:36 +00:00
victorAnumudu d56363276b made the pathname to retain the country query param 2023-09-13 05:12:27 +01:00
ameye 5a9b49559b Merge branch 'signup-page-modification' of WrenchBoard/Users-Wrench into master 2023-09-12 19:14:16 +00:00
6 changed files with 532 additions and 494 deletions
+6
View File
@@ -74,3 +74,9 @@ REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
#apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.lotus.g1.wrenchboard.com:76.209.103.227
#apigate.orion.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227
REACT_APP_MAX_CREDIT_CARDS=4
REACT_APP_MAX_CREDIT_BANK_ACCOUNT=4
REACT_APP_MAX_FAMILY_MEMBERS=8
+5
View File
@@ -46,3 +46,8 @@ REACT_APP_LOGOUT_TEXT="Sign Out"
REACT_APP_APPLE_SOCIAL_LOGIN=0 REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0 REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
REACT_APP_MAX_CREDIT_CARDS=4
REACT_APP_MAX_CREDIT_BANK_ACCOUNT=4
REACT_APP_MAX_FAMILY_MEMBERS=8
+5
View File
@@ -52,3 +52,8 @@ REACT_APP_TOTAL_NUM_FILE=4
REACT_APP_LOGOUT_TEXT="Sign Out" REACT_APP_LOGOUT_TEXT="Sign Out"
REACT_APP_APPLE_SOCIAL_LOGIN=0 REACT_APP_APPLE_SOCIAL_LOGIN=0
REACT_APP_LINKEDIN_SOCIAL_LOGIN=0 REACT_APP_LINKEDIN_SOCIAL_LOGIN=0
REACT_APP_MAX_CREDIT_CARDS=4
REACT_APP_MAX_CREDIT_BANK_ACCOUNT=4
REACT_APP_MAX_FAMILY_MEMBERS=8
+5 -2
View File
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from "react"; import React, { useCallback, useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom"; import { Link, useLocation, useNavigate } from "react-router-dom";
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png"; import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
import usersService from "../../../services/UsersService"; import usersService from "../../../services/UsersService";
import InputCom from "../../Helpers/Inputs/InputCom"; import InputCom from "../../Helpers/Inputs/InputCom";
@@ -9,6 +9,9 @@ export default function SignUp() {
const queryParams = new URLSearchParams(location?.search); const queryParams = new URLSearchParams(location?.search);
const country = queryParams.get("cnt")?.toUpperCase(); const country = queryParams.get("cnt")?.toUpperCase();
const {pathname} = useLocation()
const currentPath = country ? `${pathname}?cnt=${country.toLowerCase()}`:pathname // Determines the new pathname is country query params exist
const [signUpLoading, setSignUpLoading] = useState(false); const [signUpLoading, setSignUpLoading] = useState(false);
const [checked, setValue] = useState(false); const [checked, setValue] = useState(false);
// for the catch error // for the catch error
@@ -146,7 +149,7 @@ export default function SignUp() {
<AuthLayout slogan="Welcome to WrenchBoard"> <AuthLayout slogan="Welcome to WrenchBoard">
<div className="w-full"> <div className="w-full">
<div className="mb-5"> <div className="mb-5">
<Link to="#"> <Link to={currentPath}>
<img <img
src={WrenchBoard} src={WrenchBoard}
alt="wrenchboard" alt="wrenchboard"
@@ -64,6 +64,8 @@ const initialValues = {
}; };
function AddFundDollars(props) { function AddFundDollars(props) {
let MaxNoOfCards = process.env.REACT_APP_MAX_CREDIT_CARDS // HOLDS THE VALUE OF THE MAX NUMBER OF CARDS USER CAN ADD
const apiCall = new usersService(); const apiCall = new usersService();
let countryWallet = props.walletItem.country; let countryWallet = props.walletItem.country;
const [tab, setTab] = useState("previous"); const [tab, setTab] = useState("previous");
@@ -240,7 +242,7 @@ function AddFundDollars(props) {
<label <label
onClick={() => setTab("new")} onClick={() => setTab("new")}
htmlFor="new" htmlFor="new"
className="cursor-pointer flex items-center gap-1" className={`cursor-pointer flex items-center gap-1 ${payListCards.data.length >= MaxNoOfCards ? 'pointer-events-none':''}`}
> >
<input <input
id="new" id="new"
@@ -251,7 +253,7 @@ function AddFundDollars(props) {
tab == "new" ? "" : "" tab == "new" ? "" : ""
} tracking-wide transition duration-200`} } tracking-wide transition duration-200`}
/> />
Add New Card Add New Card {payListCards.data.length >= MaxNoOfCards && <span className="text-[14px] text-red-500">Max Reached</span>}
</label> </label>
</div> </div>
</form> </form>
@@ -314,6 +316,11 @@ function AddFundDollars(props) {
{tab === "new" && ( {tab === "new" && (
<div className="new-details w-full max-h-[22rem]"> <div className="new-details w-full max-h-[22rem]">
{payListCards.loading ?
<div className="pt-10 flex w-full h-full justify-center items-center">
<LoadingSpinner size='10' color='sky-blue' />
</div>
:payListCards.data.length < MaxNoOfCards ?
<div className="w-full flex flex-col justify-between"> <div className="w-full flex flex-col justify-between">
<Formik <Formik
initialValues={initialValues} initialValues={initialValues}
@@ -553,6 +560,9 @@ function AddFundDollars(props) {
}} }}
</Formik> </Formik>
</div> </div>
:
null
}
</div> </div>
)} )}
</div> </div>
@@ -12,6 +12,8 @@ function NairaWithdraw({
state, state,
setShowConfirmNairaWithdraw, setShowConfirmNairaWithdraw,
}) { }) {
let MaxNoOfBanks = process.env.REACT_APP_MAX_CREDIT_BANK_ACCOUNT // HOLDS THE VALUE OF THE MAX NUMBER OF BANKS USER CAN ADD
const apiCall = new usersService(); const apiCall = new usersService();
const [tab, setTab] = useState("previous"); const [tab, setTab] = useState("previous");
let [requestStatus, setRequestStatus] = useState(false); let [requestStatus, setRequestStatus] = useState(false);
@@ -422,7 +424,7 @@ function NairaWithdraw({
<label <label
onClick={() => setTab("new")} onClick={() => setTab("new")}
htmlFor="new" htmlFor="new"
className="cursor-pointer flex items-center gap-1" className={`cursor-pointer flex items-center gap-1 ${recipients.data.length >= MaxNoOfBanks ? 'pointer-events-none':''}`}
> >
<input <input
id="new" id="new"
@@ -434,7 +436,7 @@ function NairaWithdraw({
tab == "new" ? "" : "" tab == "new" ? "" : ""
} tracking-wide transition duration-200`} } tracking-wide transition duration-200`}
/> />
New Account{" "} New Account{" "} {recipients.data.length >= MaxNoOfBanks && <span className="text-[14px] text-red-500">Max Reached</span>}
</label> </label>
</div> </div>
</div> </div>
@@ -522,6 +524,11 @@ function NairaWithdraw({
)} )}
{tab == "new" && ( {tab == "new" && (
recipients.loading ?
<div className="mt-3 flex flex-col w-full h-[188px] justify-center items-center">
<LoadingSpinner size='10' color='sky-blue' />
</div>
:recipients.data.length < MaxNoOfBanks ?
<div className="w-full mt-3 rounded-md bg-slate-100"> <div className="w-full mt-3 rounded-md bg-slate-100">
<div className="relative fields w-full flex flex-col p-4"> <div className="relative fields w-full flex flex-col p-4">
<div className="flex flex-[2] min-h-[52px]"> <div className="flex flex-[2] min-h-[52px]">
@@ -789,6 +796,8 @@ function NairaWithdraw({
{/* end of inputs for new accounts */} {/* end of inputs for new accounts */}
</div> </div>
</div> </div>
:
<div className="mt-3 flex w-full h-[188px] justify-center items-center"></div>
)} )}
</div> </div>