Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b01139b93 | |||
| 99c81fd4ee | |||
| ef545c9714 | |||
| 029a7327a8 | |||
| 5a5d933b24 | |||
| 9f19c930b7 | |||
| 84d7fabae7 | |||
| b245f87556 | |||
| bed5303fa4 | |||
| a5af8ed722 | |||
| ec97d118b2 | |||
| 85213c31a1 | |||
| f9b6c68f99 | |||
| 2a4b77c9a0 | |||
| 97aa5dba21 | |||
| 58a10ca6be | |||
| f3edf1d90b | |||
| 1f7b310b6f | |||
| aecb06ca96 | |||
| d89194f18e | |||
| 03866d666b | |||
| 4224be46bc | |||
| 5dad00096a | |||
| 72da5c707a | |||
| 625928e34b | |||
| 6fd92600b4 | |||
| 133f500849 | |||
| b1f1b34924 | |||
| e80c3528db | |||
| 3eb6960cc7 | |||
| eb01e35c75 | |||
| 0cc70d66b3 | |||
| 7111e81f11 | |||
| 1c64771dcd | |||
| ac1a4f895a | |||
| 22f5bd01d2 | |||
| 467528835a |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" id="identificationcard"><path fill="#4687ba" d="M0 6v13c0 1.103.897 2 2 2h20c1.103 0 2-.897 2-2V6" class="color2d98d4 svgShape"></path><path fill="#ff6699" d="M22 3H2a2 2 0 0 0-2 2v2h24V5a2 2 0 0 0-2-2z" class="color0377be svgShape"></path><path fill="#e6e7f9" d="M22 3H2C.897 3 0 3.897 0 5v.25c0-1.103.897-2 2-2h20c1.103 0 2 .897 2 2V5c0-1.103-.897-2-2-2z" opacity=".2" class="colorffffff svgShape"></path><path fill="#4687ba" d="M22 20.75H2c-1.103 0-2-.897-2-2V19c0 1.103.897 2 2 2h20c1.103 0 2-.897 2-2v-.25c0 1.103-.897 2-2 2z" opacity=".1" class="color010101 svgShape"></path><path fill="#e6e7f9" d="M13 17h8v1h-8zM13 14h8v1h-8zM13 11h8v1h-8z" class="colorffffff svgShape"></path><circle cx="7" cy="12" r="2" fill="#e6e7f9" class="colorffffff svgShape"></circle><path fill="#e6e7f9" d="M9.987 15.237C9.288 14.9 8.203 14.5 7 14.5s-2.288.4-2.987.737c-.625.3-1.013.9-1.013 1.566V18h8v-1.197c0-.665-.388-1.265-1.013-1.566z" class="colorffffff svgShape"></path><circle cx="17" cy="5" r="1" fill="#ff6699" class="color0a70b9 svgShape"></circle><path fill="#4687ba" d="M17 4.25a.99.99 0 0 1 .975.875C17.98 5.082 18 5.045 18 5a1 1 0 0 0-2 0c0 .044.02.082.025.125A.99.99 0 0 1 17 4.25z" opacity=".1" class="color010101 svgShape"></path><linearGradient id="a" x1="6.973" x2="21.55" y1="1.973" y2="16.55" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#010101" stop-opacity=".1" class="stopColor010101 svgShape"></stop><stop offset="1" stop-color="#010101" stop-opacity="0" class="stopColor010101 svgShape"></stop></linearGradient><path fill="url(#a)" d="M22 21c1.103 0 2-.897 2-2V7H0l14 14h8z"></path><circle cx="7" cy="5" r="1" fill="#ff6699" class="color0a70b9 svgShape"></circle><path fill="#4687ba" d="M7 4.25a.99.99 0 0 1 .975.875C7.98 5.082 8 5.045 8 5a1 1 0 0 0-2 0c0 .044.02.082.025.125A.99.99 0 0 1 7 4.25z" opacity=".1" class="color010101 svgShape"></path><linearGradient id="b" x1="-.708" x2="24.708" y1="6.074" y2="17.925" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffffff" stop-opacity=".2" class="stopColorffffff svgShape"></stop><stop offset="1" stop-color="#ffffff" stop-opacity="0" class="stopColorffffff svgShape"></stop></linearGradient><path fill="url(#b)" d="M22 3H2a2 2 0 0 0-2 2v14c0 1.103.897 2 2 2h20c1.103 0 2-.897 2-2V5a2 2 0 0 0-2-2z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 128 128" viewBox="0 0 128 128" id="Pin"><path fill="#4687ba" d="M106,13.8L91.7,4.6C86.2,1,78.9,2,74.5,7L41.9,46.9c-9.1,0.4-17.9,3.3-25.4,8.7c-0.7,0.5-0.7,1.6,0.1,2.1
|
||||||
|
l10.2,6.6l0,0L46.4,77l-24,41.4c-1.2,2.1-0.7,4.9,1.4,6.3c2.2,1.6,5.2,1.1,6.7-1.1l28-38.8L78,97.5l0,0l10.2,6.6
|
||||||
|
c0.7,0.5,1.7,0.1,1.9-0.8c1.8-9,0.9-18.3-2.5-26.8l23.1-46C113.6,24.5,111.5,17.4,106,13.8z" class="color2d3e50 svgShape"></path></svg>
|
||||||
|
After Width: | Height: | Size: 482 B |
@@ -1,23 +1,64 @@
|
|||||||
import React, {useState, useEffect} from 'react'
|
import React, { useEffect } from 'react';
|
||||||
import { useLocation, useNavigate } from 'react-router-dom'
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
|
import usersService from '../../../services/UsersService';
|
||||||
|
import {updateUserDetails} from "../../../store/UserDetails";
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import AuthLayout from "../AuthLayout";
|
||||||
|
|
||||||
function Redirect() {
|
function Redirect() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const userApi = new usersService();
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const codeResponse = queryParams.get("code");
|
const codeResponse = queryParams.get("code");
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!codeResponse){
|
if(!codeResponse){
|
||||||
navigate('/login', {replace: true})
|
navigate('/login', {state: {error: true}})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(codeResponse);
|
||||||
|
/*
|
||||||
|
POST /token HTTP/1.1
|
||||||
|
Host: oauth2.googleapis.com
|
||||||
|
Content-Type: application/x-www-form-urlencoded
|
||||||
|
|
||||||
|
code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7&
|
||||||
|
client_id=your_client_id&
|
||||||
|
client_secret=your_client_secret&
|
||||||
|
redirect_uri=https%3A//oauth2.example.com/code&
|
||||||
|
grant_type=authorization_code
|
||||||
|
*/
|
||||||
|
var reqData = {
|
||||||
|
auth_type: "GOOGLE",
|
||||||
|
code: codeResponse,
|
||||||
|
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||||
|
};
|
||||||
|
userApi
|
||||||
|
.authStart(reqData)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.status == 200 && res.data.internal_return >= 0 && res.data.member_id && res.data.uid && res.data.session) {
|
||||||
|
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||||
|
localStorage.setItem("uid", `${res.data.uid}`);
|
||||||
|
localStorage.setItem("session_token", `${res.data.session}`);
|
||||||
|
dispatch(updateUserDetails({...res.data}));
|
||||||
|
navigate('/', {replace: true})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(codeResponse)
|
navigate('/login', {state: {error: true}})
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
navigate('/login', {state: {error: true}})
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
},[])
|
},[])
|
||||||
return (
|
return (
|
||||||
<div>Redirecting ... </div>
|
<AuthLayout>
|
||||||
|
<div className='min-h-[70vh]'>Redirecting ... </div>
|
||||||
|
</AuthLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Redirect
|
export default Redirect
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useLayoutEffect, useState } from "react";
|
import React, { useEffect, useLayoutEffect, useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate, useLocation } from "react-router-dom";
|
||||||
import linkedInLogo from "../../../assets/images/Linkedin.png";
|
import linkedInLogo from "../../../assets/images/Linkedin.png";
|
||||||
import appleLogo from "../../../assets/images/apple-black.svg";
|
import appleLogo from "../../../assets/images/apple-black.svg";
|
||||||
import facebookLogo from "../../../assets/images/facebook-4.svg";
|
import facebookLogo from "../../../assets/images/facebook-4.svg";
|
||||||
@@ -16,12 +16,15 @@ import { updateUserDetails } from "../../../store/UserDetails";
|
|||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
const {state} = useLocation()
|
||||||
|
|
||||||
let [loginType, setLoginType] = useState('');
|
let [loginType, setLoginType] = useState('');
|
||||||
|
|
||||||
const [checked, setValue] = useState(false);
|
const [checked, setValue] = useState(false);
|
||||||
const [loginLoading, setLoginLoading] = useState(false);
|
const [loginLoading, setLoginLoading] = useState(false);
|
||||||
|
|
||||||
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
|
||||||
//login error state
|
//login error state
|
||||||
const [loginError, setLoginError] = useState(false);
|
const [loginError, setLoginError] = useState(false);
|
||||||
// for the catch error
|
// for the catch error
|
||||||
@@ -31,6 +34,11 @@ export default function Login() {
|
|||||||
setValue(!checked);
|
setValue(!checked);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// To Show and Hide Password
|
||||||
|
const togglePasswordVisibility = () => {
|
||||||
|
setShowPassword(!showPassword);
|
||||||
|
};
|
||||||
|
|
||||||
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
|
//FUNCTION TO DETERMINE/CHANGE LOGIN COMPONENT
|
||||||
const handleLoginType = ({ target: { name } }) => {
|
const handleLoginType = ({ target: { name } }) => {
|
||||||
setLoginType(name);
|
setLoginType(name);
|
||||||
@@ -69,6 +77,14 @@ export default function Login() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//checks if email is a valid email address
|
||||||
|
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
||||||
|
if (regEx.test(email) == false) {
|
||||||
|
setLoginLoading(false);
|
||||||
|
setMsgError("Invalid Email");
|
||||||
|
return setTimeout(()=>{setMsgError("");},3000)
|
||||||
|
}
|
||||||
|
|
||||||
if (name == "full") {
|
if (name == "full") {
|
||||||
// Post Data Info for normal Login
|
// Post Data Info for normal Login
|
||||||
postData = {
|
postData = {
|
||||||
@@ -98,7 +114,7 @@ export default function Login() {
|
|||||||
userApi
|
userApi
|
||||||
.logInUser(postData)
|
.logInUser(postData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status != 200 || res.data.internal_return < 0) {
|
if (res.status != 200 || res.data.internal_return < 0 || !res.data.member_id || !res.data.uid || !res.data.session) {
|
||||||
// setMsgError("Wrong, email/password");
|
// setMsgError("Wrong, email/password");
|
||||||
setLoginError(true);
|
setLoginError(true);
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
@@ -108,7 +124,7 @@ export default function Login() {
|
|||||||
localStorage.setItem("uid", `${res.data.uid}`);
|
localStorage.setItem("uid", `${res.data.uid}`);
|
||||||
localStorage.setItem("session_token", `${res.data.session}`);
|
localStorage.setItem("session_token", `${res.data.session}`);
|
||||||
// localStorage.setItem("session", `${res.data.session}`);
|
// localStorage.setItem("session", `${res.data.session}`);
|
||||||
dispatch(updateUserDetails({...res.data, loggedIn:true}));
|
dispatch(updateUserDetails({...res.data}));
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
navigate("/", { replace: true });
|
navigate("/", { replace: true });
|
||||||
setLoginLoading(false);
|
setLoginLoading(false);
|
||||||
@@ -168,6 +184,14 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
let loginValue = readCookie('loginType')
|
let loginValue = readCookie('loginType')
|
||||||
setLoginType(loginValue)
|
setLoginType(loginValue)
|
||||||
|
|
||||||
|
if(state?.error){ //check if the login path has an error state indicating any social handle login with error
|
||||||
|
setMsgError("Unexpected Error, Please try again soon.");
|
||||||
|
setTimeout(()=>{
|
||||||
|
setMsgError("");
|
||||||
|
navigate('/login', {replace: true})
|
||||||
|
},4000)
|
||||||
|
}
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
|
|
||||||
@@ -189,7 +213,7 @@ export default function Login() {
|
|||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="content-wrapper login shadow-md w-full lg:max-w-[500px] mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5">
|
<div className="content-wrapper login shadow-md w-full lg:max-w-[530px] mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
{/* <h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
{/* <h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
||||||
@@ -211,7 +235,7 @@ export default function Login() {
|
|||||||
<button
|
<button
|
||||||
name="full"
|
name="full"
|
||||||
className={`login-type-btn px-4 py-1 rounded-t-2xl ${
|
className={`login-type-btn px-4 py-1 rounded-t-2xl ${
|
||||||
loginType=='full' ? "bg-white text-[#000] border-t-[2px]" : "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
loginType=='full' ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
}`}
|
}`}
|
||||||
onClick={handleLoginType}
|
onClick={handleLoginType}
|
||||||
>
|
>
|
||||||
@@ -220,7 +244,7 @@ export default function Login() {
|
|||||||
<button
|
<button
|
||||||
name="family"
|
name="family"
|
||||||
className={`login-type-btn px-4 py-1 rounded-t-2xl ${
|
className={`login-type-btn px-4 py-1 rounded-t-2xl ${
|
||||||
loginType=='family' ? "bg-white text-[#000] border-t-[2px]" : "bg-[#4687ba] border-[2px] border-[#4687ba] text-white"
|
loginType=='family' ? "bg-[#4687ba] border-[2px] border-[#4687ba] text-white" : "bg-white text-[#000] border-t-[2px]"
|
||||||
}`}
|
}`}
|
||||||
onClick={handleLoginType}
|
onClick={handleLoginType}
|
||||||
>
|
>
|
||||||
@@ -234,7 +258,7 @@ export default function Login() {
|
|||||||
{
|
{
|
||||||
loginType == 'full' ? (
|
loginType == 'full' ? (
|
||||||
//user login component
|
//user login component
|
||||||
<div className="p-2 input-area login-area border-2 border-[#4687ba] rounded-2xl">
|
<div className="p-6 input-area login-area border-2 border-[#4687ba] rounded-2xl">
|
||||||
<div className="input-item mb-5">
|
<div className="input-item mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
labelClass="tracking-wider"
|
labelClass="tracking-wider"
|
||||||
@@ -258,8 +282,9 @@ export default function Login() {
|
|||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Password"
|
label="Password"
|
||||||
name="password"
|
name="password"
|
||||||
type="password"
|
type={showPassword ? "text" : "password"}
|
||||||
iconName="password"
|
onClick={togglePasswordVisibility}
|
||||||
|
passIcon={showPassword ? "password" : "password"}
|
||||||
forgotPassword
|
forgotPassword
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -322,7 +347,7 @@ export default function Login() {
|
|||||||
) : (
|
) : (
|
||||||
// END of user login compoenent
|
// END of user login compoenent
|
||||||
// family login compoenent
|
// family login compoenent
|
||||||
<div className="p-2 input-area login-area border-2 border-[#4687ba] rounded-2xl">
|
<div className="p-6 input-area login-area border-2 border-[#4687ba] rounded-2xl">
|
||||||
<div className="input-item mb-5">
|
<div className="input-item mb-5">
|
||||||
<InputCom
|
<InputCom
|
||||||
labelClass="tracking-wider"
|
labelClass="tracking-wider"
|
||||||
@@ -333,7 +358,7 @@ export default function Login() {
|
|||||||
label="Username"
|
label="Username"
|
||||||
name="email"
|
name="email"
|
||||||
type="email"
|
type="email"
|
||||||
iconName="message"
|
iconName="family-id"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -346,9 +371,9 @@ export default function Login() {
|
|||||||
placeholder="● ● ● ● ● ●"
|
placeholder="● ● ● ● ● ●"
|
||||||
label="Pin"
|
label="Pin"
|
||||||
name="password"
|
name="password"
|
||||||
type="password"
|
type={showPassword ? "text" : "password"}
|
||||||
iconName="password"
|
onClick={togglePasswordVisibility}
|
||||||
// forgotPassword
|
passIcon={showPassword ? "family-pin" : "family-pin"}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{loginError && (
|
{loginError && (
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ export default function SignUp() {
|
|||||||
return setTimeout(()=>{setMsgError("");},3000)
|
return setTimeout(()=>{setMsgError("");},3000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//checks if terms and condition is checked
|
||||||
|
if (!checked) {
|
||||||
|
setMsgError("Terms and condition required");
|
||||||
|
return setTimeout(()=>{setMsgError("");},3000)
|
||||||
|
}
|
||||||
|
|
||||||
setSignUpLoading(true);
|
setSignUpLoading(true);
|
||||||
const reqData = {
|
const reqData = {
|
||||||
country: country,
|
country: country,
|
||||||
@@ -89,7 +95,7 @@ export default function SignUp() {
|
|||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
if (data && data.acc === "DULPICATE") {
|
if (data && data.acc === "DULPICATE") {
|
||||||
setMsgError("This account has been already created");
|
setMsgError("Unable to use this username. Please try another username.");
|
||||||
setSignUpLoading(false);
|
setSignUpLoading(false);
|
||||||
}
|
}
|
||||||
if (data && data.status === "1") {
|
if (data && data.status === "1") {
|
||||||
@@ -131,7 +137,7 @@ export default function SignUp() {
|
|||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="content-wrapper login shadow-md w-full lg:max-w-[500px] mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5 mb-0">
|
<div className="content-wrapper login relative shadow-md w-full lg:max-w-[530px] mx-auto flex justify-center items-center xl:bg-white dark:bg-dark-white 2xl:w-[828px] rounded-[0.475rem] sm:p-7 p-5 mb-0">
|
||||||
<div>
|
<div>
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
||||||
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
<h1 className="text-[#181c32] font-semibold dark:text-white mb-3 leading-[27.3px] text-[22.75px]">
|
||||||
@@ -213,7 +219,7 @@ export default function SignUp() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{msgError && (
|
{msgError && (
|
||||||
<div className="relative p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px]">
|
<div className="p-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px]">
|
||||||
{msgError}
|
{msgError}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -298,7 +304,7 @@ const SelectOption = ({
|
|||||||
<select
|
<select
|
||||||
name={name}
|
name={name}
|
||||||
id={name}
|
id={name}
|
||||||
className="input-wrapper border border-[#f5f8fa]] dark:border-[#5e6278] w-full rounded-[0.475rem] h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
className="input-wrapper border border-[#f5f8fa] dark:border-[#5e6278] w-full rounded-full h-[42px] overflow-hidden relative font-medium leading-6 bg-clip-padding text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] dark:bg-[#5e6278] text-base focus-visible:border-transparent focus-visible:outline-0 focus-visible:ring-transparent "
|
||||||
onChange={inputHandler}
|
onChange={inputHandler}
|
||||||
value={value}
|
value={value}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -86,10 +86,14 @@ export default function VerifyLink() {
|
|||||||
const verifyRes = await userApi.verifyEmail(code);
|
const verifyRes = await userApi.verifyEmail(code);
|
||||||
if (verifyRes.status === 200) {
|
if (verifyRes.status === 200) {
|
||||||
let { data } = verifyRes;
|
let { data } = verifyRes;
|
||||||
|
console.log('TESTING VERIFY',data)
|
||||||
if (
|
if (
|
||||||
data &&
|
data &&
|
||||||
data.internal_return >= 0 &&
|
data.internal_return >= 0 &&
|
||||||
|
data.status == 0 &&
|
||||||
|
data.pending_id != '' &&
|
||||||
|
data.pending_uid != '' &&
|
||||||
|
data.username != '' &&
|
||||||
data.status_text === "Link Verified"
|
data.status_text === "Link Verified"
|
||||||
) {
|
) {
|
||||||
setPageLoader(false);
|
setPageLoader(false);
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) {
|
|||||||
toast.warn("Remove to Favorite List");
|
toast.warn("Remove to Favorite List");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//debugger;
|
||||||
|
const bannerName = datas.banner == null ?'default.jpg':datas.banner;
|
||||||
return (
|
return (
|
||||||
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
|
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
|
||||||
<div className="content">
|
<div className="content">
|
||||||
@@ -32,7 +33,7 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) {
|
|||||||
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
|
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${localImgLoad(
|
background: `url(${localImgLoad(
|
||||||
`images/taskbanners/${datas.banner}`
|
`images/taskbanners/${bannerName}`
|
||||||
)}) center / contain no-repeat`,
|
)}) center / contain no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ export default function HomeBannerOffersCard(props) {
|
|||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
to={link_result}
|
to={link_result}
|
||||||
className="item w-full block group banner-630-340 bg-cover bg-center"
|
className="item p-2 w-full flex items-center min-h-[340px] bg-alice-blue bg-cover bg-center"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url('${imageUrl}')`,
|
backgroundImage: `url('${imageUrl}')`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col justify-between h-full">
|
<div className="w-[80%] h-full mx-auto flex flex-col justify-between">
|
||||||
<div className="content flex justify-between items-center">
|
<div className="content flex justify-between items-center">
|
||||||
<div className="siderCardHeader">
|
<div className="mb-2">
|
||||||
<h1 className="text-2xl font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-2xl lg:text-4xl font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
<span className="heroSilderTitle">{props.itemData.title}</span>
|
<span className="heroSilderTitle">{props.itemData.title}</span>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col justify-around items-center flex-1">
|
<div className="flex flex-col justify-around items-center flex-1">
|
||||||
<div className="siderCardDescription">
|
<div className="siderCardDescription mb-2">
|
||||||
{props.itemData.description}
|
{props.itemData.description}
|
||||||
</div>
|
</div>
|
||||||
<button className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
<button className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
import React, {
|
import React, {
|
||||||
Suspense,
|
Suspense,
|
||||||
|
lazy,
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
|
useTransition,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { useReactToPrint } from "react-to-print";
|
import { useReactToPrint } from "react-to-print";
|
||||||
import profile from "../../assets/images/profile-info-profile.png";
|
import profile from "../../assets/images/profile-info-profile.png";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import AssignTaskPopout from "./FamilyPopout/AssignTaskPopout";
|
import AssignTaskPopout from "./FamilyPopout/AssignTaskPopout";
|
||||||
import {
|
|
||||||
FamilyWaitlist,
|
|
||||||
FamilyAccount,
|
|
||||||
FamilyProfile,
|
|
||||||
FamilyTasks,
|
|
||||||
ProfileInfo,
|
|
||||||
FamilyPending,
|
|
||||||
} from "./Tabs";
|
|
||||||
import localImgLoad from "../../lib/localImgLoad";
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
|
// Lazy Imports for components
|
||||||
|
const FamilyWaitlist = lazy(() => import("./Tabs/FamilyWaitlist"));
|
||||||
|
const FamilyAccount = lazy(() => import("./Tabs/FamilyAccount"));
|
||||||
|
const FamilyProfile = lazy(() => import("./Tabs/FamilyProfile"));
|
||||||
|
const FamilyTasks = lazy(() => import("./Tabs/FamilyTasks"));
|
||||||
|
const ProfileInfo = lazy(() => import("./Tabs/ProfileInfo"));
|
||||||
|
const FamilyPending = lazy(() => import("./Tabs/FamilyPending"));
|
||||||
|
|
||||||
export default function FamilyManageTabs({
|
export default function FamilyManageTabs({
|
||||||
className,
|
className,
|
||||||
accountDetails,
|
accountDetails,
|
||||||
@@ -35,14 +37,15 @@ export default function FamilyManageTabs({
|
|||||||
});
|
});
|
||||||
const [errMsg, setErrMsg] = useState("");
|
const [errMsg, setErrMsg] = useState("");
|
||||||
const [familyTaskPopout, setFamilyTaskPopout] = useState(false);
|
const [familyTaskPopout, setFamilyTaskPopout] = useState(false);
|
||||||
|
const [profileImg, setProfileImg] = useState(profile);
|
||||||
|
const profileImgInput = useRef(null);
|
||||||
|
const [isPending, startTransition] = useTransition();
|
||||||
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
|
||||||
const familyPopUpHandler = () => {
|
const familyPopUpHandler = () => {
|
||||||
setFamilyTaskPopout((prev) => !prev);
|
setFamilyTaskPopout((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [profileImg, setProfileImg] = useState(profile);
|
|
||||||
const profileImgInput = useRef(null);
|
|
||||||
|
|
||||||
const browseProfileImg = () => {
|
const browseProfileImg = () => {
|
||||||
profileImgInput.current.click();
|
profileImgInput.current.click();
|
||||||
};
|
};
|
||||||
@@ -57,16 +60,15 @@ export default function FamilyManageTabs({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
|
||||||
|
|
||||||
const manageFamily = useCallback(async () => {
|
const manageFamily = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
setDetails({
|
setDetails((prevDetails) => ({
|
||||||
|
...prevDetails,
|
||||||
familyDetails: { loading: true },
|
familyDetails: { loading: true },
|
||||||
familyTasks: { loading: true },
|
familyTasks: { loading: true },
|
||||||
familyWaitList: { loading: true },
|
familyWaitList: { loading: true },
|
||||||
familyPending: { loading: true },
|
familyPending: { loading: true },
|
||||||
});
|
}));
|
||||||
|
|
||||||
const { family_uid } = accountDetails;
|
const { family_uid } = accountDetails;
|
||||||
const reqData = { family_uid };
|
const reqData = { family_uid };
|
||||||
@@ -89,22 +91,26 @@ export default function FamilyManageTabs({
|
|||||||
tasksData?.internal_return < 0 ||
|
tasksData?.internal_return < 0 ||
|
||||||
familyWaitData?.internal_return < 0 ||
|
familyWaitData?.internal_return < 0 ||
|
||||||
familyPendingData?.internal_return < 0
|
familyPendingData?.internal_return < 0
|
||||||
)
|
) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setDetails({
|
startTransition(() => {
|
||||||
familyDetails: { loading: false, data: familyData },
|
setDetails({
|
||||||
familyTasks: { loading: false, data: tasksData },
|
familyDetails: { loading: false, data: familyData },
|
||||||
familyWaitList: { loading: false, data: familyWaitData },
|
familyTasks: { loading: false, data: tasksData },
|
||||||
familyPending: { loading: false, data: familyPendingData },
|
familyWaitList: { loading: false, data: familyWaitData },
|
||||||
|
familyPending: { loading: false, data: familyPendingData },
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setDetails({
|
setDetails((prevDetails) => ({
|
||||||
|
...prevDetails,
|
||||||
familyDetails: { loading: false },
|
familyDetails: { loading: false },
|
||||||
familyTasks: { loading: false },
|
familyTasks: { loading: false },
|
||||||
familyWaitList: { loading: false },
|
familyWaitList: { loading: false },
|
||||||
familyPending: { loading: false },
|
familyPending: { loading: false },
|
||||||
});
|
}));
|
||||||
setErrMsg("An error occurred");
|
setErrMsg("An error occurred");
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
@@ -119,13 +125,15 @@ export default function FamilyManageTabs({
|
|||||||
const tabs = [
|
const tabs = [
|
||||||
{ id: 1, name: "Tasks" },
|
{ id: 1, name: "Tasks" },
|
||||||
{ id: 2, name: "Waiting" },
|
{ id: 2, name: "Waiting" },
|
||||||
{ id: 3, name: "Pending" }
|
{ id: 3, name: "Pending" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const [tab, setTab] = useState(tabs[0].name);
|
const [tab, setTab] = useState(tabs[0].name);
|
||||||
|
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
startTransition(() => {
|
||||||
|
setTab(value);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
@@ -174,7 +182,13 @@ export default function FamilyManageTabs({
|
|||||||
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
manageFamily();
|
let __manageFamily = true;
|
||||||
|
if (__manageFamily) {
|
||||||
|
manageFamily();
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
__manageFamily = false;
|
||||||
|
};
|
||||||
}, [tab, manageFamily]);
|
}, [tab, manageFamily]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -202,15 +216,25 @@ export default function FamilyManageTabs({
|
|||||||
/>
|
/>
|
||||||
<div className="mt-4 flex justify-center items-center gap-2">
|
<div className="mt-4 flex justify-center items-center gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={() => tabHandler('Account')}
|
onClick={() => tabHandler("Account")}
|
||||||
className="family-icon p-2 border-2 border-sky-blue rounded-2xl flex flex-col justify-between items-center">
|
className="family-icon p-2 border-2 border-sky-blue rounded-2xl flex flex-col justify-between items-center"
|
||||||
<img src={localImgLoad('images/icons/account.svg')} className="w-[70px] h-[70px]" alt='Settings-Icon' />
|
>
|
||||||
|
<img
|
||||||
|
src={localImgLoad("images/icons/account.svg")}
|
||||||
|
className="w-[70px] h-[70px]"
|
||||||
|
alt="Settings-Icon"
|
||||||
|
/>
|
||||||
<p className="mt-2 text-lg text-sky-blue">Account</p>
|
<p className="mt-2 text-lg text-sky-blue">Account</p>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => tabHandler('Profile')}
|
onClick={() => tabHandler("Profile")}
|
||||||
className="family-icon p-2 border-2 border-sky-blue rounded-2xl flex flex-col justify-between items-center">
|
className="family-icon p-2 border-2 border-sky-blue rounded-2xl flex flex-col justify-between items-center"
|
||||||
<img src={localImgLoad('images/icons/profile.svg')} className="w-[70px] h-[70px]" alt='Settings-Icon' />
|
>
|
||||||
|
<img
|
||||||
|
src={localImgLoad("images/icons/profile.svg")}
|
||||||
|
className="w-[70px] h-[70px]"
|
||||||
|
alt="Settings-Icon"
|
||||||
|
/>
|
||||||
<p className="mt-2 text-lg text-sky-blue">Profile</p>
|
<p className="mt-2 text-lg text-sky-blue">Profile</p>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -243,7 +267,11 @@ export default function FamilyManageTabs({
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex-[0.9] lg:min-h-[450px] h-full">
|
<div className="flex-[0.9] lg:min-h-[450px] h-full">
|
||||||
<div className="h-full p-4 border border-[#dbd9d9] relative overflow-y-auto">
|
<div className="h-full p-4 border border-[#dbd9d9] relative overflow-y-auto">
|
||||||
{selectedTabComponent}
|
<Suspense
|
||||||
|
fallback={<LoadingSpinner size="16" color="sky-blue" />}
|
||||||
|
>
|
||||||
|
{selectedTabComponent}
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect, useTransition } from "react";
|
||||||
import ModalCom from "../../Helpers/ModalCom";
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
import Detail from "../../jobPopout/popoutcomponent/Detail";
|
import Detail from "../../jobPopout/popoutcomponent/Detail";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
@@ -6,7 +6,7 @@ import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
|||||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
import { NewTasks } from "./forms";
|
import { NewTasks } from "./forms";
|
||||||
|
|
||||||
function AssignTaskPopout({ action, situation, familyDetails }) {
|
const AssignTaskPopout = React.memo(({ action, details, situation, familyDetails }) => {
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
|
|
||||||
let [requestStatus, setRequestStatus] = useState({
|
let [requestStatus, setRequestStatus] = useState({
|
||||||
@@ -15,9 +15,9 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
message: "",
|
message: "",
|
||||||
}); // HOLDS RESPONSE FOR SENDING API REQUEST
|
}); // HOLDS RESPONSE FOR SENDING API REQUEST
|
||||||
|
|
||||||
let [familyTask, setFamilyTask] = useState({ loading: true, data: [] });
|
let [familyTask, setFamilyTask] = useState({ loading: false, data: [] });
|
||||||
|
|
||||||
let [taskType, setTaskType] = useState("select"); // SWITCHES BTW SELECT TASK AND NEW TASK
|
let [taskType, setTaskType] = useState(details ? "new" : "select"); // SWITCHES BTW SELECT TASK AND NEW TASK
|
||||||
|
|
||||||
let [activeTask, setActiveTask] = useState({ id: 0, data: {} }); // HOLDS SELECTED TASK
|
let [activeTask, setActiveTask] = useState({ id: 0, data: {} }); // HOLDS SELECTED TASK
|
||||||
|
|
||||||
@@ -34,14 +34,14 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
// New Task
|
// New Task
|
||||||
const [formState, setFormState] = useState({
|
const [formState, setFormState] = useState({
|
||||||
// Initialize form state with desired fields
|
// Initialize form state with desired fields
|
||||||
banner: "" || "default.jpg",
|
banner: details?.banner || "default.jpg",
|
||||||
country: "" || "",
|
country: details?.country || "",
|
||||||
price: "" || "",
|
price: details?.price || "",
|
||||||
title: "" || "",
|
title: details?.title || "",
|
||||||
description: "" || "",
|
description: details?.description || "",
|
||||||
job_detail: "" || "",
|
job_detail: details?.job_detail || "",
|
||||||
timeline_days: "" || "",
|
timeline_days: details?.timeline_days || "",
|
||||||
category: [] || "",
|
category: details?.category || "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const assignFamilyTask = () => {
|
const assignFamilyTask = () => {
|
||||||
@@ -81,30 +81,29 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
title,
|
title,
|
||||||
} = formState;
|
} = formState;
|
||||||
|
|
||||||
const requiredFields = [
|
const requiredFields = {
|
||||||
banner,
|
banner,
|
||||||
category,
|
// category,
|
||||||
country,
|
country,
|
||||||
description,
|
description,
|
||||||
job_detail,
|
job_detail,
|
||||||
price,
|
price,
|
||||||
timeline_days,
|
timeline_days,
|
||||||
title,
|
title,
|
||||||
];
|
};
|
||||||
|
|
||||||
if (requiredFields.some((field) => !field)) {
|
for (let field in requiredFields) {
|
||||||
const emptyField = requiredFields.find((field) => !field);
|
if (requiredFields[field] == "") {
|
||||||
setRequestStatus({
|
// let currencyErrMsg = field == "country" && "currency"
|
||||||
loading: false,
|
setRequestStatus({
|
||||||
status: false,
|
loading: false,
|
||||||
message: `${emptyField} Empty`,
|
status: false,
|
||||||
});
|
message: `${field} is empty`,
|
||||||
|
});
|
||||||
setTimeout(() => {
|
return setTimeout(() => {
|
||||||
setRequestStatus({ loading: false, status: false, message: "" });
|
setRequestStatus({ loading: false, status: false, message: "" });
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reqData = {
|
reqData = {
|
||||||
@@ -117,7 +116,7 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
timeline_days,
|
timeline_days,
|
||||||
title,
|
title,
|
||||||
assign_mode: 110055,
|
assign_mode: 110055,
|
||||||
family_uid: familyDetails.uid,
|
family_uid: details?.family_uid || familyDetails?.uid,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,37 +156,48 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let checkFamilyTask = true;
|
||||||
const reqData = {
|
const reqData = {
|
||||||
limit: 30,
|
limit: 30,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
job_type: "FAMILY",
|
job_type: "FAMILY",
|
||||||
action: 13005,
|
action: 13005,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiCall
|
apiCall
|
||||||
.getMyJobList(reqData)
|
.getMyJobList(reqData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setFamilyTask({ loading: false, data: res?.data?.result_list });
|
if (checkFamilyTask) {
|
||||||
if (res?.data?.result_list?.length) {
|
setFamilyTask({ loading: false, data: res?.data?.result_list });
|
||||||
setActiveTask((prev) => ({
|
if (res?.data?.result_list?.length) {
|
||||||
...prev,
|
setActiveTask((prev) => ({
|
||||||
data: res?.data?.result_list[0],
|
...prev,
|
||||||
}));
|
data: res?.data?.result_list[0],
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
setFamilyTask({ loading: false, data: [] });
|
setFamilyTask({ loading: false, data: [] });
|
||||||
console.log("Error", err);
|
console.log("Error", err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
checkFamilyTask = false;
|
||||||
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log("Trying to see form data >>", formState);
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ModalCom action={action} situation={situation} className="assign-task-popup">
|
<ModalCom
|
||||||
|
action={action}
|
||||||
|
situation={situation}
|
||||||
|
className="assign-task-popup"
|
||||||
|
>
|
||||||
<div className="w-full h-full lg:w-[700px] lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<div className="w-full h-full lg:w-[700px] lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
||||||
<div className="w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
<div className="w-full flex items-center justify-between lg:px-10 lg:py-8 px-[30px] py-[23px] border-b dark:border-[#5356fb29] border-light-purple">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
Assign task to {familyDetails?.firstname}
|
Assign task to {familyDetails?.firstname || details.firstName}
|
||||||
</h1>
|
</h1>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -362,55 +372,62 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* BTN */}
|
{/* BTN */}
|
||||||
<div className="p-2 border-t-2 flex justify-end items-center gap-3">
|
<div className="py-2 px-4 border-t-2 flex justify-between items-center">
|
||||||
{/* error or success display */}
|
{/* error or success display */}
|
||||||
{requestStatus.message != "" &&
|
<div className="w-auto h-auto flex items-center">
|
||||||
(!requestStatus.status ? (
|
{requestStatus.message != "" &&
|
||||||
<div
|
(!requestStatus.status ? (
|
||||||
className={`relative p-2 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
|
||||||
>
|
|
||||||
{requestStatus.message}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
requestStatus.status && (
|
|
||||||
<div
|
<div
|
||||||
className={`relative p-2 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
className={`relative p-2 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px] self-start`}
|
||||||
>
|
>
|
||||||
{requestStatus.message}
|
{requestStatus.message}
|
||||||
</div>
|
</div>
|
||||||
)
|
) : (
|
||||||
))}
|
requestStatus.status && (
|
||||||
|
<div
|
||||||
|
className={`relative p-2 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{requestStatus.message}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* End of error or success display */}
|
{/* End of error or success display */}
|
||||||
<button
|
<div className="w-auto h-auto flex items-center gap-3">
|
||||||
disabled={requestStatus.loading}
|
<button
|
||||||
onClick={action}
|
disabled={requestStatus.loading}
|
||||||
type="button"
|
onClick={action}
|
||||||
className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white cursor-pointer"
|
type="button"
|
||||||
>
|
className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white cursor-pointer"
|
||||||
<span className="text-gradient">Close</span>
|
>
|
||||||
</button>
|
<span className="text-gradient">Close</span>
|
||||||
<div className="">
|
</button>
|
||||||
{requestStatus.loading ? (
|
<div className="">
|
||||||
<LoadingSpinner color="sky-blue" size="8" />
|
{requestStatus.loading ? (
|
||||||
) : taskType == "select" ? (
|
<LoadingSpinner color="sky-blue" size="8" />
|
||||||
<button
|
) : taskType == "select" ? (
|
||||||
type="button"
|
<button
|
||||||
disabled={requestStatus.loading}
|
type="button"
|
||||||
onClick={assignFamilyTask}
|
disabled={requestStatus.loading}
|
||||||
className="px-1 w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white cursor-pointer"
|
onClick={assignFamilyTask}
|
||||||
>
|
className="px-1 w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white cursor-pointer"
|
||||||
Assign
|
>
|
||||||
</button>
|
Assign
|
||||||
) : (
|
</button>
|
||||||
<button
|
) : (
|
||||||
type="button"
|
<button
|
||||||
disabled={requestStatus.loading}
|
type="button"
|
||||||
onClick={assignFamilyTask}
|
disabled={requestStatus.loading}
|
||||||
className="px-1 w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white cursor-pointer"
|
onClick={assignFamilyTask}
|
||||||
>
|
className="px-1 w-40 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white cursor-pointer"
|
||||||
{`Assign to ${familyDetails?.firstname}`}
|
>
|
||||||
</button>
|
{`Assign to ${
|
||||||
)}
|
familyDetails?.firstname || details?.firstName
|
||||||
|
}`}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@@ -419,6 +436,6 @@ function AssignTaskPopout({ action, situation, familyDetails }) {
|
|||||||
</ModalCom>
|
</ModalCom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
})
|
||||||
|
|
||||||
export default AssignTaskPopout;
|
export default AssignTaskPopout;
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import usersService from "../../../../services/UsersService";
|
import usersService from "../../../../services/UsersService";
|
||||||
import InputCom from "../../../Helpers/Inputs/InputCom";
|
import InputCom from "../../../Helpers/Inputs/InputCom";
|
||||||
import debounce from "../../../../hooks/debounce";
|
|
||||||
|
|
||||||
const DEFAULT_IMAGE = require("../../../../assets/images/taskbanners/default.jpg");
|
|
||||||
export default function NewTasks({ formState, setFormState }) {
|
export default function NewTasks({ formState, setFormState }) {
|
||||||
let [currency, setCurrency] = useState({
|
let [currency, setCurrency] = useState({
|
||||||
loading: true,
|
loading: true,
|
||||||
@@ -11,6 +9,9 @@ export default function NewTasks({ formState, setFormState }) {
|
|||||||
data: null,
|
data: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const selectImage = require(`../../../../assets/images/taskbanners/${
|
||||||
|
formState.banner || "default.jpg"
|
||||||
|
}`);
|
||||||
const ApiCall = new usersService();
|
const ApiCall = new usersService();
|
||||||
|
|
||||||
// FUNCTION TO GET Currency
|
// FUNCTION TO GET Currency
|
||||||
@@ -47,7 +48,7 @@ export default function NewTasks({ formState, setFormState }) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form className="w-full flex justify-between items-center">
|
<form className="w-full flex justify-between items-start">
|
||||||
<div className="flex flex-col gap-3 max-w-[77%]">
|
<div className="flex flex-col gap-3 max-w-[77%]">
|
||||||
{/* inputs starts here */}
|
{/* inputs starts here */}
|
||||||
<div className="grid md:grid-cols-3 grid-cols-1 gap-6 mb-[5px]">
|
<div className="grid md:grid-cols-3 grid-cols-1 gap-6 mb-[5px]">
|
||||||
@@ -207,7 +208,7 @@ export default function NewTasks({ formState, setFormState }) {
|
|||||||
<div className="max-w-[20%] w-full">
|
<div className="max-w-[20%] w-full">
|
||||||
<div className="h-32 w-full">
|
<div className="h-32 w-full">
|
||||||
<img
|
<img
|
||||||
src={DEFAULT_IMAGE}
|
src={selectImage}
|
||||||
alt="task_banner_img"
|
alt="task_banner_img"
|
||||||
className="w-full h-full object-contain"
|
className="w-full h-full object-contain"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import PaginatedList from "../Pagination/PaginatedList";
|
|||||||
import familyImage from '../../assets/images/no-family-side.png'
|
import familyImage from '../../assets/images/no-family-side.png'
|
||||||
|
|
||||||
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
export default function FamilyTable({ className, familyList, loader, popUpHandler }) {
|
||||||
const filterCategories = ["All Categories", "Explore", "Featured"];
|
|
||||||
const [selectedCategory, setCategory] = useState(filterCategories[0]);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
// let location = useLocation();
|
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
import { forwardRef } from 'react'
|
import { forwardRef } from "react";
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from "react-qr-code";
|
||||||
|
|
||||||
const FamilyAccount = forwardRef(({ familyData, myRef, handlePrint }, ref) => {
|
const FamilyAccount = forwardRef(({ familyData, myRef, handlePrint }, ref) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="w-full lg:min-h-[500px] h-full flex flex-col items-center justify-center"
|
className="w-full lg:min-h-[500px] h-full flex flex-col items-center justify-center"
|
||||||
ref={myRef}
|
ref={myRef}
|
||||||
>
|
>
|
||||||
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
<div className="update-table w-full lg:min-h-[450px] h-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow ">
|
||||||
<div className="flex items-center justify-around h-[380px]">
|
<div className="flex items-center justify-around h-[380px]">
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
Username:{" "}
|
Username:{" "}
|
||||||
<span className="ml-2 normal-case">
|
<span className="ml-2 normal-case">
|
||||||
{familyData?.username ? familyData?.username : "please wait..."}
|
{familyData?.username ? familyData?.username : "please wait..."}
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<h2 className="font-bold text-lg tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
Pin:{" "}
|
Pin:{" "}
|
||||||
<span className="ml-2 normal-case">
|
<span className="ml-2 normal-case">
|
||||||
{familyData?.pin ? familyData?.pin : "please wait..."}
|
{familyData?.pin ? familyData?.pin : "please wait..."}
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
|
||||||
|
|
||||||
<span className="text-5xl text-gray-400 opacity-20 font-bold">
|
|
||||||
or
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<div className="max-w-[200px]">
|
|
||||||
<p className="text-xl tracking-wide mb-[15px] text-center font-bold text-dark-gray dark:text-white">
|
|
||||||
Scan the code from mobile app
|
|
||||||
</p>
|
|
||||||
<QRCode
|
|
||||||
size={256}
|
|
||||||
style={{ height: "auto", maxWidth: "100%", width: "100%" }}
|
|
||||||
value={`https://www.google.com`}
|
|
||||||
viewBox={`0 0 256 256`}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="h-[50px] w-full flex justify-center items-center">
|
|
||||||
<button
|
<span className="text-5xl text-gray-400 opacity-20 font-bold">
|
||||||
className="btn-shine w-[116px] h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
or
|
||||||
onClick={handlePrint}
|
</span>
|
||||||
>
|
|
||||||
Print
|
<div className="max-w-[200px]">
|
||||||
</button>
|
<p className="text-xl tracking-wide mb-[15px] text-center font-bold text-dark-gray dark:text-white">
|
||||||
|
Scan the code from mobile app
|
||||||
|
</p>
|
||||||
|
<QRCode
|
||||||
|
size={256}
|
||||||
|
style={{ height: "auto", maxWidth: "100%", width: "100%" }}
|
||||||
|
value={`https://www.google.com`}
|
||||||
|
viewBox={`0 0 256 256`}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="h-[50px] w-full flex justify-center items-center">
|
||||||
|
<button
|
||||||
|
className="btn-shine w-[116px] h-[46px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
||||||
|
onClick={handlePrint}
|
||||||
|
>
|
||||||
|
Print
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
});
|
);
|
||||||
|
});
|
||||||
|
|
||||||
export default FamilyAccount
|
export default FamilyAccount;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { PaginatedList, handlePagingFunc } from "../../Pagination";
|
import { PaginatedList, handlePagingFunc } from "../../Pagination";
|
||||||
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
import dataImage2 from "../../../assets/images/data-table-user-2.png";
|
import dataImage2 from "../../../assets/images/data-table-user-2.png";
|
||||||
@@ -13,8 +13,12 @@ export default function FamilyPending({
|
|||||||
}) {
|
}) {
|
||||||
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
||||||
|
|
||||||
let filteredFamilyData = familyData?.result_list?.filter(
|
let filteredFamilyData = useMemo(
|
||||||
(data) => data?.family_uid === accountDetails?.family_uid
|
() =>
|
||||||
|
familyData?.result_list?.filter(
|
||||||
|
(data) => data?.family_uid === accountDetails?.family_uid
|
||||||
|
),
|
||||||
|
[accountDetails?.family_uid, familyData?.result_list]
|
||||||
);
|
);
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
@@ -51,7 +55,7 @@ export default function FamilyPending({
|
|||||||
value?.currency_code,
|
value?.currency_code,
|
||||||
value?.currency
|
value?.currency
|
||||||
);
|
);
|
||||||
let image = value.banner ? value.banner : 'default.jpg'
|
let image = value.banner ? value.banner : "default.jpg";
|
||||||
return (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
@@ -61,7 +65,9 @@ export default function FamilyPending({
|
|||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full">
|
||||||
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
|
<div className="w-[60px] h-[60px] p-2 bg-alice-blue rounded-full overflow-hidden flex justify-center items-center">
|
||||||
<img
|
<img
|
||||||
src={localImgLoad(`images/taskbanners/${image}`)}
|
src={localImgLoad(
|
||||||
|
`images/taskbanners/${image}`
|
||||||
|
)}
|
||||||
alt="data"
|
alt="data"
|
||||||
className="w-full h-full rounded-full"
|
className="w-full h-full rounded-full"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,26 +1,50 @@
|
|||||||
import { useState } from "react";
|
import { useState, useMemo, memo } from "react";
|
||||||
import { handlePagingFunc, PaginatedList } from "../../Pagination";
|
import { handlePagingFunc, PaginatedList } from "../../Pagination";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
import SuggestTask from "../../FamilyPopup/SuggestTask";
|
import SuggestTask from "../../FamilyPopup/SuggestTask";
|
||||||
|
import AssignTaskPopout from "../FamilyPopout/AssignTaskPopout";
|
||||||
|
|
||||||
const FamilyWaitlist = ({ familyData, className, accountDetails, loader }) => {
|
const FamilyWaitlist = memo(({ familyData, className, accountDetails, loader }) => {
|
||||||
const [popUp, setPopUp] = useState({ show: false, data: {} });
|
const [popUp, setPopUp] = useState({ show: false, data: {} });
|
||||||
|
const [continueTaskPopup, setContinueTaskPopup] = useState({
|
||||||
let filteredFamilyData = familyData?.result_list?.filter(
|
show: false,
|
||||||
(data) => data?.family_uid === accountDetails?.family_uid
|
data: {},
|
||||||
|
});
|
||||||
|
const filteredFamilyData = useMemo(
|
||||||
|
() =>
|
||||||
|
familyData?.result_list?.filter(
|
||||||
|
(data) => data?.family_uid === accountDetails?.family_uid
|
||||||
|
),
|
||||||
|
[familyData, accountDetails]
|
||||||
);
|
);
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
const itemsPerPage = Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
const itemsPerPage = Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
const indexOfFirstItem = currentPage;
|
const indexOfFirstItem = currentPage;
|
||||||
const indexOfLastItem = currentPage + itemsPerPage;
|
const indexOfLastItem = currentPage + itemsPerPage;
|
||||||
const currentTask = filteredFamilyData?.slice(
|
const currentTask = useMemo(
|
||||||
indexOfFirstItem,
|
() => filteredFamilyData?.slice(indexOfFirstItem, indexOfLastItem),
|
||||||
indexOfLastItem
|
[filteredFamilyData, indexOfFirstItem, indexOfLastItem]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
|
const handlePagination = (e) => handlePagingFunc(e, setCurrentPage);
|
||||||
|
|
||||||
|
const openPopUp = (value) => {
|
||||||
|
setPopUp({ show: true, data: { ...value } });
|
||||||
|
};
|
||||||
|
|
||||||
|
const closePopUp = () => {
|
||||||
|
setPopUp({ show: false, data: {} });
|
||||||
|
};
|
||||||
|
|
||||||
|
const openContinueTaskPopup = (value) => {
|
||||||
|
setContinueTaskPopup({ show: true, data: { ...value } });
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeContinueTaskPopup = () => {
|
||||||
|
setContinueTaskPopup({ show: false, data: {} });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[450px] overflow-hidden rounded-2xl section-shadow ${
|
className={`update-table w-full bg-white dark:bg-dark-white h-full lg:min-h-[450px] overflow-hidden rounded-2xl section-shadow ${
|
||||||
@@ -78,12 +102,7 @@ const FamilyWaitlist = ({ familyData, className, accountDetails, loader }) => {
|
|||||||
</td>
|
</td>
|
||||||
<td className="text-right py-4 px-2">
|
<td className="text-right py-4 px-2">
|
||||||
<button
|
<button
|
||||||
onClick={() =>
|
onClick={() => openPopUp(value)}
|
||||||
setPopUp({
|
|
||||||
show: true,
|
|
||||||
data: { ...value, selectedImage },
|
|
||||||
})
|
|
||||||
}
|
|
||||||
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
>
|
>
|
||||||
View
|
View
|
||||||
@@ -109,14 +128,21 @@ const FamilyWaitlist = ({ familyData, className, accountDetails, loader }) => {
|
|||||||
{popUp.show && (
|
{popUp.show && (
|
||||||
<SuggestTask
|
<SuggestTask
|
||||||
details={popUp.data}
|
details={popUp.data}
|
||||||
onClose={() => {
|
onClose={closePopUp}
|
||||||
setPopUp({ show: false, data: {} });
|
continuePopupData={openContinueTaskPopup}
|
||||||
}}
|
|
||||||
situation={popUp.show}
|
situation={popUp.show}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{continueTaskPopup.show && (
|
||||||
|
<AssignTaskPopout
|
||||||
|
details={continueTaskPopup.data}
|
||||||
|
action={closeContinueTaskPopup}
|
||||||
|
situation={continueTaskPopup.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
export default FamilyWaitlist;
|
export default FamilyWaitlist;
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
import React, {
|
||||||
|
Suspense,
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import FamilyTable from "./FamilyTable";
|
import FamilyTable from "./FamilyTable";
|
||||||
import SiteService from "../../services/SiteService";
|
import SiteService from "../../services/SiteService";
|
||||||
import ModalCom from "../Helpers/ModalCom";
|
import ModalCom from "../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
export default function FamilyAcc() {
|
export default function FamilyAcc() {
|
||||||
const [selectTab, setValue] = useState("today");
|
const [selectTab, setValue] = useState("today");
|
||||||
@@ -20,60 +27,50 @@ export default function FamilyAcc() {
|
|||||||
|
|
||||||
const apiCall = useMemo(() => new SiteService(), []);
|
const apiCall = useMemo(() => new SiteService(), []);
|
||||||
|
|
||||||
// This is to make sure it's called once and used everywhere
|
|
||||||
let memberId = localStorage.getItem("member_id");
|
|
||||||
let uid = localStorage.getItem("uid");
|
|
||||||
let sessionId = localStorage.getItem("session_token");
|
|
||||||
|
|
||||||
const popUpHandler = () => {
|
const popUpHandler = () => {
|
||||||
setPopUp((prev) => !prev);
|
setPopUp((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
// tab handler
|
|
||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// For the age drop down
|
const ageRange = useMemo(() => {
|
||||||
let startAge = 5;
|
const startAge = 5;
|
||||||
let endAge = 16;
|
const endAge = 16;
|
||||||
// creates an array of age values ranging from 16 to 70
|
return Array.from(
|
||||||
const ageRange = Array.from(
|
{ length: endAge - startAge + 1 },
|
||||||
{ length: endAge - startAge + 1 },
|
(_, index) => startAge + index
|
||||||
(_, index) => startAge + index
|
);
|
||||||
);
|
}, []);
|
||||||
// age handler
|
|
||||||
const handleAgeSelect = (event) => {
|
const handleAgeSelect = (event) => {
|
||||||
setSelectedAge(parseInt(event.target.value));
|
setSelectedAge(parseInt(event.target.value));
|
||||||
};
|
};
|
||||||
// Input handler
|
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
const { name, value } = event?.target;
|
const { name, value } = event?.target;
|
||||||
setFormData({ ...formData, [name]: value });
|
setFormData((prevFormData) => ({ ...prevFormData, [name]: value }));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add member
|
|
||||||
const addMember = async () => {
|
const addMember = async () => {
|
||||||
const { first_name, last_name } = formData;
|
const { first_name, last_name } = formData;
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
try {
|
try {
|
||||||
if (first_name !== "" && last_name !== "") {
|
if (first_name !== "" && last_name !== "") {
|
||||||
let reqData = {
|
const reqData = {
|
||||||
member_id: memberId,
|
|
||||||
uid: uid,
|
|
||||||
session_id: sessionId,
|
|
||||||
firstname: first_name,
|
firstname: first_name,
|
||||||
lastname: last_name,
|
lastname: last_name,
|
||||||
age: selectedAge,
|
age: selectedAge,
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await apiCall.addFamily(reqData);
|
const res = await apiCall.addFamily(reqData);
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
|
|
||||||
if (data?.internal_return > 0 && data?.status == "OK") {
|
if (data?.internal_return > 0 && data?.status === "OK") {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setListReload((prev) => !prev);
|
setListReload((prev) => !prev);
|
||||||
popUpHandler()
|
popUpHandler();
|
||||||
} else {
|
} else {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setMsgErr("Sorry, something went wrong");
|
setMsgErr("Sorry, something went wrong");
|
||||||
@@ -94,38 +91,42 @@ export default function FamilyAcc() {
|
|||||||
first_name: "",
|
first_name: "",
|
||||||
last_name: "",
|
last_name: "",
|
||||||
});
|
});
|
||||||
setSelectedAge("")
|
setSelectedAge("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// member listing
|
|
||||||
const memberList = useCallback(async () => {
|
const memberList = useCallback(async () => {
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
try {
|
try {
|
||||||
let reqData = {
|
const reqData = {
|
||||||
member_id: memberId,
|
|
||||||
uid: uid,
|
|
||||||
session_id: sessionId,
|
|
||||||
limit: 20,
|
limit: 20,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
action: 22010,
|
action: 22010,
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = await apiCall.familyListings(reqData);
|
const res = await apiCall.familyListings(reqData);
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
if (data?.internal_return >= 0 && data?.status == "OK") {
|
if (data?.internal_return >= 0 && data?.status === "OK") {
|
||||||
let { result_list } = data;
|
const { result_list } = data;
|
||||||
setFamilyList(result_list);
|
setFamilyList(result_list);
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
} else return;
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}, [apiCall, memberId, sessionId, uid]);
|
}, [apiCall]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
memberList();
|
let checkMemberList = true;
|
||||||
|
if (checkMemberList) {
|
||||||
|
memberList();
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
checkMemberList = false;
|
||||||
|
};
|
||||||
}, [listReload, memberList]);
|
}, [listReload, memberList]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -158,7 +159,13 @@ export default function FamilyAcc() {
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FamilyTable familyList={familyList} loader={loader} popUpHandler={popUpHandler} />
|
<Suspense fallback={<LoadingSpinner color="sky-blue" size="16" />}>
|
||||||
|
<FamilyTable
|
||||||
|
familyList={familyList}
|
||||||
|
loader={loader}
|
||||||
|
popUpHandler={popUpHandler}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{popUp && (
|
{popUp && (
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import usersService from "../../services/UsersService";
|
|||||||
import Icons from "../Helpers/Icons";
|
import Icons from "../Helpers/Icons";
|
||||||
|
|
||||||
const DEFAULT_IMAGE = require("../../assets/images/family/default.jpg");
|
const DEFAULT_IMAGE = require("../../assets/images/family/default.jpg");
|
||||||
const SuggestTask = ({ details, onClose, situation }) => {
|
const SuggestTask = ({ details, onClose, situation, continuePopupData }) => {
|
||||||
const { pathname, state } = useLocation();
|
const { pathname, state } = useLocation();
|
||||||
const [submitTask, setSubmitTask] = useState({
|
const [submitTask, setSubmitTask] = useState({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -16,7 +16,7 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
});
|
});
|
||||||
const [suggestedNextStep, setSuggestedNextStep] = useState("Send Task");
|
const [suggestedNextStep, setSuggestedNextStep] = useState("Send Task");
|
||||||
|
|
||||||
const switchNextStep = (value) => {
|
const switchNextStep = ({ target: value }) => {
|
||||||
setSuggestedNextStep(value);
|
setSuggestedNextStep(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -29,8 +29,9 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
|
|
||||||
const handleSubmit = async (values) => {
|
const handleSuggestedTask = async (values) => {
|
||||||
if (!values.title && !values.description) return;
|
if (!values.title && !values.description) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setSubmitTask({ loading: true });
|
setSubmitTask({ loading: true });
|
||||||
const reqData = { ...values };
|
const reqData = { ...values };
|
||||||
@@ -49,7 +50,15 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log("state >-->>", state);
|
const handleParentSuggestion = (values) => {
|
||||||
|
if (suggestedNextStep == "Send Task") {
|
||||||
|
let firstName = state?.firstname;
|
||||||
|
let family_uid = state?.family_uid;
|
||||||
|
continuePopupData({ ...details, firstName, family_uid });
|
||||||
|
}
|
||||||
|
onClose();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper lw-[90%] md:w-[768px] h-full lg:h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
@@ -87,7 +96,11 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
</div>
|
</div>
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
onSubmit={pathname !== "/manage-family" && handleSubmit}
|
onSubmit={
|
||||||
|
pathname !== "/manage-family"
|
||||||
|
? handleSuggestedTask
|
||||||
|
: handleParentSuggestion
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{(props) => {
|
{(props) => {
|
||||||
return (
|
return (
|
||||||
@@ -164,7 +177,7 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Radio buttons for family */}
|
{/* Radio buttons for family */}
|
||||||
{pathname === "/manage-family" && (
|
{pathname === "/manage-family" ? (
|
||||||
<div className="h-[20px] w-full border-t dark:border-[#5356fb29] border-light-purple relative">
|
<div className="h-[20px] w-full border-t dark:border-[#5356fb29] border-light-purple relative">
|
||||||
<div id="my-radio-group" className="sr-only">
|
<div id="my-radio-group" className="sr-only">
|
||||||
Parent suggested next step
|
Parent suggested next step
|
||||||
@@ -182,18 +195,22 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
<label
|
<label
|
||||||
role="group"
|
role="group"
|
||||||
key={idx}
|
key={idx}
|
||||||
htmlFor="parent-suggested"
|
htmlFor={`parent-suggested-${idx}`}
|
||||||
|
className={`transition duration-150 ease-in-out parent-suggest group cursor-pointer`}
|
||||||
|
onClick={() => setSuggestedNextStep(title)}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name="parent-suggested"
|
name="parent-suggested"
|
||||||
value={title}
|
value={title}
|
||||||
checked={title == suggestedNextStep}
|
checked={suggestedNextStep === title}
|
||||||
onChange={switchNextStep}
|
onChange={switchNextStep}
|
||||||
className={`transition duration-150 ease-in-out parent-suggest`}
|
className={`transition duration-150 ease-in-out parent-suggest pointer-events-none`}
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
onClick={switchNextStep}
|
onClick={() => setSuggestedNextStep(title)}
|
||||||
|
id={`parent-suggested-${idx}`}
|
||||||
|
name="parent-suggested"
|
||||||
className={`ml-1 ${
|
className={`ml-1 ${
|
||||||
title == "Not Now"
|
title == "Not Now"
|
||||||
? "text-red-500"
|
? "text-red-500"
|
||||||
@@ -208,9 +225,10 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-full h-[70px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
|
<div className="w-full h-[70px] border-t border-light-purple dark:border-[#5356fb29] flex justify-end items-center">
|
||||||
<div className="flex items-center space-x-4 mr-9">
|
<div className="flex items-center space-x-4 mr-9">
|
||||||
<button
|
<button
|
||||||
@@ -220,31 +238,33 @@ const SuggestTask = ({ details, onClose, situation }) => {
|
|||||||
>
|
>
|
||||||
<span className="text-gradient"> Cancel</span>
|
<span className="text-gradient"> Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
{pathname !== "/manage-family" ? (
|
<button
|
||||||
<button
|
type="submit"
|
||||||
type="submit"
|
disabled={props.isSubmitting}
|
||||||
disabled={props.isSubmitting}
|
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full transition duration-150 ease-in-out flex items-center"
|
||||||
className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full transition duration-150 ease-in-out"
|
>
|
||||||
>
|
{pathname !== "/manage-family" ? (
|
||||||
{submitTask.loading
|
<>
|
||||||
? "Submitting Task"
|
{submitTask.loading
|
||||||
: submitTask.state == "success"
|
? "Submitting Task"
|
||||||
? "Task Submitted"
|
: submitTask.state == "success"
|
||||||
: submitTask.state == "bad"
|
? "Task Submitted"
|
||||||
? "An Error Occurred"
|
: submitTask.state == "bad"
|
||||||
: "Send to Parents"}
|
? "An Error Occurred"
|
||||||
</button>
|
: "Send to Parents"}
|
||||||
) : (
|
</>
|
||||||
<button className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full flex items-center transition duration-150 ease-in-out">
|
) : (
|
||||||
{suggestedNextStep == "Send Task" ? (
|
<>
|
||||||
<>
|
{suggestedNextStep == "Send Task" ? (
|
||||||
Continue <Icons name="chevron-right" />
|
<>
|
||||||
</>
|
Continue <Icons name="chevron-right" />
|
||||||
) : (
|
</>
|
||||||
"Complete"
|
) : (
|
||||||
)}
|
"Complete"
|
||||||
</button>
|
)}
|
||||||
)}
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -519,7 +519,11 @@ export default function Icons({ name }) {
|
|||||||
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/market.svg')} alt="market" />
|
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/market.svg')} alt="market" />
|
||||||
) : name === "new-mytask" ? (
|
) : name === "new-mytask" ? (
|
||||||
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/my-task.svg')} alt="task" />
|
<img className="w-[17px] h-[17px]" src={localImgLoad('images/icons/my-task.svg')} alt="task" />
|
||||||
) : (
|
) : name === "family-id" ? (
|
||||||
|
<img className="w-[20px] h-[20px]" src={localImgLoad('images/icons/family-id.svg')} alt="family-id" />
|
||||||
|
) : name === "family-pin" ? (
|
||||||
|
<img className="w-[20px] h-[20px]" src={localImgLoad('images/icons/family-pin.svg')} alt="family-pin" />
|
||||||
|
): (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
import heroBg from "../../assets/images/hero-bg.svg";
|
import heroBg from "../../assets/images/bg-sky-blue.jpg"; //hero-bg.svg";
|
||||||
import heroUser from "../../assets/images/hero-user.png";
|
import heroUser from "../../assets/images/hero-user.png";
|
||||||
import CountDown from "../Helpers/CountDown";
|
import CountDown from "../Helpers/CountDown";
|
||||||
import HomeSliders from "./HomeSliders";
|
import HomeSliders from "./HomeSliders";
|
||||||
@@ -24,7 +24,7 @@ export default function Hero({ className, bannerList, nextDueTask }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`w-full lg:h-[444px] h-full lg:flex lg:p-8 p-4 justify-between items-center lg:space-x-28 rounded-2xl overflow-hidden ${
|
className={`w-full min-h-[400px] md:grid grid-cols-2 lg:p-8 p-4 justify-between items-center gap-2 rounded-2xl overflow-hidden ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
style={{
|
style={{
|
||||||
@@ -33,7 +33,7 @@ export default function Hero({ className, bannerList, nextDueTask }) {
|
|||||||
backgroundSize: "cover",
|
backgroundSize: "cover",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex-1 h-[330px] lg:h-full flex flex-col justify-between mb-5 lg:mb-0">
|
<div className="h-full flex flex-col justify-between mb-5 lg:mb-0">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div>
|
<div>
|
||||||
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
<h1 className="lg:text-2xl text-xl font-medium text-white tracking-wide">
|
||||||
@@ -57,7 +57,7 @@ export default function Hero({ className, bannerList, nextDueTask }) {
|
|||||||
</div>
|
</div>
|
||||||
{/* countdown */}
|
{/* countdown */}
|
||||||
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
{nextDueTask?.next_due && Object.keys(nextDueTask.next_due)?.length != 0 && (
|
||||||
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border border-white-opacity">
|
<div className="w-full h-32 flex justify-evenly items-center sm:p-6 p-1 rounded-2xl border back-dark1 border-white-opacity">
|
||||||
<div className="flex flex-col justify-between">
|
<div className="flex flex-col justify-between">
|
||||||
<p className="text-base text-white tracking-wide">Current Task</p>
|
<p className="text-base text-white tracking-wide">Current Task</p>
|
||||||
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
<p className="lg:text-2xl text-lg font-bold tracking-wide text-white">
|
||||||
@@ -84,7 +84,7 @@ export default function Hero({ className, bannerList, nextDueTask }) {
|
|||||||
)}
|
)}
|
||||||
{/* action */}
|
{/* action */}
|
||||||
<div className="flex lg:space-x-3 space-x-1 items-center">
|
<div className="flex lg:space-x-3 space-x-1 items-center">
|
||||||
<Link to="/mytask" className="text-white text-base sm:block hidden">
|
<Link to="/mytask" className="text-white text-base">
|
||||||
<span className=" border-b dark:border-[#5356fb29] border-white">
|
<span className=" border-b dark:border-[#5356fb29] border-white">
|
||||||
{" "}
|
{" "}
|
||||||
View All Task(s)
|
View All Task(s)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export default function HomeSliders(props) {
|
|||||||
// debugger;
|
// debugger;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="hero-slider relative 2xl:w-[600px] xl:w-[400px] lg:w-[420px] w-full mb-2 lg:mb-0 ">
|
<div className="hero-slider relative h-full w-full mb-2 lg:mb-0">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<SliderCom settings={props.settings}>
|
<SliderCom settings={props.settings}>
|
||||||
{props.bannerList?.length <= 0 && (
|
{props.bannerList?.length <= 0 && (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
|
|
||||||
function CurrentJobAction() {
|
function CurrentJobAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
<p className="my-3 py-1 text-base active-owner">
|
<p className="my-3 py-1 text-base active-owner">
|
||||||
<table className="w-full text-sm text-left text-gray-500">
|
<table className="w-full text-sm text-left text-gray-500">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
|
|
||||||
<table className="w-full text-sm text-left text-gray-500 active-worker">
|
<table className="w-full text-sm text-left text-gray-500 active-worker">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
|
|
||||||
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
|
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
|
|
||||||
function PastDueTaskAction() {
|
function PastDueTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
|
|
||||||
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
|
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function ReviewJobAction({jobDetails}) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
<div className="my-3 py-1 text-base">
|
<div className="my-3 py-1 text-base">
|
||||||
<table className="w-full text-sm text-left text-gray-500 review-owner">
|
<table className="w-full text-sm text-left text-gray-500 review-owner">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react'
|
|||||||
|
|
||||||
function ReviewTaskAction() {
|
function ReviewTaskAction() {
|
||||||
return (
|
return (
|
||||||
<div className='job-action bg-white dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
|
<p className="my-3 py-1 text-base text-dark-gray dark:text-white">
|
||||||
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
Waiting for the completion message from the client before you can approve. Worker True & Review Job
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import AddFund from './AddFund'
|
|||||||
import AddRecipient from './AddRecipient'
|
import AddRecipient from './AddRecipient'
|
||||||
import ConfirmTransfer from './ConfirmTransfer'
|
import ConfirmTransfer from './ConfirmTransfer'
|
||||||
import ConfirmAddFund from './ConfirmAddFund'
|
import ConfirmAddFund from './ConfirmAddFund'
|
||||||
|
import WalletBox from "./WalletBox";
|
||||||
|
|
||||||
function Wallet() {
|
function Wallet() {
|
||||||
return (
|
return (
|
||||||
@@ -71,7 +72,8 @@ const WalletRoutes = () => {
|
|||||||
<Route path='add-fund' element={<AddFund payment={paymentHistory} />} />
|
<Route path='add-fund' element={<AddFund payment={paymentHistory} />} />
|
||||||
<Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} />
|
<Route path='add-fund/confirm-add-fund' element={<ConfirmAddFund payment={paymentHistory} />} />
|
||||||
<Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} />
|
<Route path='transfer-fund' element={<TransferFund payment={paymentHistory} wallet={walletList} />} />
|
||||||
<Route index element={<Balance wallet={walletList} />} />
|
{/*<Route index element={<Balance wallet={walletList} />} />*/}
|
||||||
|
<Route index element={<WalletBox wallet={walletList} />} />
|
||||||
<Route path='transfer-fund/add-recipient' element={<AddRecipient />} />
|
<Route path='transfer-fund/add-recipient' element={<AddRecipient />} />
|
||||||
<Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} />
|
<Route path='transfer-fund/confirm-transfer' element={<ConfirmTransfer payment={paymentHistory} wallet={walletList} />} />
|
||||||
<Route path='*' element={<Navigate to='/' />} />
|
<Route path='*' element={<Navigate to='/' />} />
|
||||||
|
|||||||
@@ -0,0 +1,273 @@
|
|||||||
|
import React from "react";
|
||||||
|
import bank1 from "../../assets/images/bank-1.png";
|
||||||
|
import bank2 from "../../assets/images/bank-2.png";
|
||||||
|
import bank3 from "../../assets/images/bank-3.png";
|
||||||
|
import bank4 from "../../assets/images/bank-4.png";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
import CurrencyStaticsSection from "./CurrencyStaticsSection";
|
||||||
|
import CurrentBalanceWidget from "./CurrentBalanceWidget";
|
||||||
|
import InvestmentSection from "./InvestmentSection";
|
||||||
|
import RecentTransactionWidget from "./RecentTransactionWidget";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import WalletItemCard from "./WalletItemCard";
|
||||||
|
|
||||||
|
export default function WalletBox({wallet, coupon}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
|
||||||
|
<div className="my-wallet-wrapper w-full mb-10">
|
||||||
|
<div className="main-wrapper w-full">
|
||||||
|
<div className="balance-inquery w-full lg:h-[436px] lg:flex lg:space-x-11 mb-11">
|
||||||
|
{wallet.loading ?
|
||||||
|
<LoadingSpinner size='16' color='sky-blue' />
|
||||||
|
:
|
||||||
|
wallet.data.length ?
|
||||||
|
wallet.data.map((item, index)=> (
|
||||||
|
<div className="lg:w-1/2 h-full mb-10 lg:mb-0">
|
||||||
|
<WalletItemCard walletItem={item} />
|
||||||
|
</div>
|
||||||
|
)) : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
{/*<div className="flex-1">*/}
|
||||||
|
{/* <CurrentBalanceWidget />*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
{/* <div className="flex-1">*/}
|
||||||
|
{/* <div className="my-wallets w-full h-full bg-white dark:bg-dark-white rounded-lg p-6">*/}
|
||||||
|
{/* <div className="mb-4">*/}
|
||||||
|
{/* <h1 className="text-xl font-bold tracking-wide text-dark-gray dark:text-white">*/}
|
||||||
|
{/* My Wallet*/}
|
||||||
|
{/* </h1>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="content-area">*/}
|
||||||
|
{/* <div className="flex justify-between items-center mb-6">*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div className="account-name flex space-x-4 items-center">*/}
|
||||||
|
{/* <div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">*/}
|
||||||
|
{/* <img src={bank1} alt="" />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="name">*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
|
||||||
|
{/* MetaMask*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white text-right mb-3">*/}
|
||||||
|
{/* $734.79*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* <p className="text-sm text-thin-light-gray">*/}
|
||||||
|
{/* New Add*/}
|
||||||
|
{/* <span className="text-light-green ml-1">*/}
|
||||||
|
{/* +324.75*/}
|
||||||
|
{/* </span>*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/*<span className="dark:text-thin-light-gray text-[#374557]">*/}
|
||||||
|
{/* <svg*/}
|
||||||
|
{/* width="6"*/}
|
||||||
|
{/* height="26"*/}
|
||||||
|
{/* viewBox="0 0 6 26"*/}
|
||||||
|
{/* fill="none"*/}
|
||||||
|
{/* className="fill-current"*/}
|
||||||
|
{/* xmlns="http://www.w3.org/2000/svg"*/}
|
||||||
|
{/* >*/}
|
||||||
|
{/* <circle cx="3" cy="3" r="3" fillOpacity="0.6" />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="12.75"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="22.5"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* </svg>*/}
|
||||||
|
{/*</span>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex justify-between items-center mb-6">*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div className="account-name flex space-x-4 items-center">*/}
|
||||||
|
{/* <div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">*/}
|
||||||
|
{/* <img src={bank2} alt="" />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="name">*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
|
||||||
|
{/* Coinbase Wallet*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white text-right mb-3">*/}
|
||||||
|
{/* $734.79*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* <p className="text-sm text-thin-light-gray">*/}
|
||||||
|
{/* New Add*/}
|
||||||
|
{/* <span className="text-light-green ml-1">*/}
|
||||||
|
{/* +324.75*/}
|
||||||
|
{/* </span>*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/*<span className="dark:text-thin-light-gray text-[#374557]">*/}
|
||||||
|
{/* <svg*/}
|
||||||
|
{/* width="6"*/}
|
||||||
|
{/* height="26"*/}
|
||||||
|
{/* viewBox="0 0 6 26"*/}
|
||||||
|
{/* fill="none"*/}
|
||||||
|
{/* className="fill-current"*/}
|
||||||
|
{/* xmlns="http://www.w3.org/2000/svg"*/}
|
||||||
|
{/* >*/}
|
||||||
|
{/* <circle cx="3" cy="3" r="3" fillOpacity="0.6" />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="12.75"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="22.5"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* </svg>*/}
|
||||||
|
{/*</span>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex justify-between items-center mb-6">*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div className="account-name flex space-x-4 items-center">*/}
|
||||||
|
{/* <div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">*/}
|
||||||
|
{/* <img src={bank3} alt="" />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="name">*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
|
||||||
|
{/* Bitski*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white text-right mb-3">*/}
|
||||||
|
{/* $734.79*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* <p className="text-sm text-thin-light-gray">*/}
|
||||||
|
{/* New Add*/}
|
||||||
|
{/* <span className="text-light-green ml-1">*/}
|
||||||
|
{/* +324.75*/}
|
||||||
|
{/* </span>*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/*<span className="dark:text-thin-light-gray text-[#374557]">*/}
|
||||||
|
{/* <svg*/}
|
||||||
|
{/* width="6"*/}
|
||||||
|
{/* height="26"*/}
|
||||||
|
{/* viewBox="0 0 6 26"*/}
|
||||||
|
{/* fill="none"*/}
|
||||||
|
{/* className="fill-current"*/}
|
||||||
|
{/* xmlns="http://www.w3.org/2000/svg"*/}
|
||||||
|
{/* >*/}
|
||||||
|
{/* <circle cx="3" cy="3" r="3" fillOpacity="0.6" />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="12.75"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="22.5"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* </svg>*/}
|
||||||
|
{/*</span>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex justify-between items-center mb-6">*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div className="account-name flex space-x-4 items-center">*/}
|
||||||
|
{/* <div className="icon w-14 h-14 transition duration-300 ease-in-out rounded-full flex justify-center items-center bg-light-purple dark:bg-dark-light-purple ">*/}
|
||||||
|
{/* <img src={bank4} alt="" />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="name">*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white tracking-wide">*/}
|
||||||
|
{/* WalletConnect*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className="flex space-x-5 items-center">*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/* <p className="text-xl font-bold text-dark-gray dark:text-white text-right mb-3">*/}
|
||||||
|
{/* $734.79*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* <p className="text-sm text-thin-light-gray">*/}
|
||||||
|
{/* New Add*/}
|
||||||
|
{/* <span className="text-light-green ml-1">*/}
|
||||||
|
{/* +324.75*/}
|
||||||
|
{/* </span>*/}
|
||||||
|
{/* </p>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div>*/}
|
||||||
|
{/*<span className="dark:text-thin-light-gray text-[#374557]">*/}
|
||||||
|
{/* <svg*/}
|
||||||
|
{/* width="6"*/}
|
||||||
|
{/* height="26"*/}
|
||||||
|
{/* viewBox="0 0 6 26"*/}
|
||||||
|
{/* fill="none"*/}
|
||||||
|
{/* className="fill-current"*/}
|
||||||
|
{/* xmlns="http://www.w3.org/2000/svg"*/}
|
||||||
|
{/* >*/}
|
||||||
|
{/* <circle cx="3" cy="3" r="3" fillOpacity="0.6" />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="12.75"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* <circle*/}
|
||||||
|
{/* cx="3"*/}
|
||||||
|
{/* cy="22.5"*/}
|
||||||
|
{/* r="3"*/}
|
||||||
|
{/* fillOpacity="0.6"*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/* </svg>*/}
|
||||||
|
{/*</span>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
</div>
|
||||||
|
{/* flex space-x-11 */}
|
||||||
|
{/*<div className="recent-and-investment grid lg:grid-cols-2 grid-cols-1 2xl:gap-[40px] xl:gap-7 gap-4 lg:h-[416px] w-full justify-between">*/}
|
||||||
|
{/* <div className=" h-full">*/}
|
||||||
|
{/* <RecentTransactionWidget />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div className=" h-full">*/}
|
||||||
|
{/* <InvestmentSection />*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*</div>*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import background from "../../assets/images/bg-sky-blue.jpg" //shape/balance-bg.svg";
|
||||||
|
import {PriceFormatter} from "../Helpers/PriceFormatter";
|
||||||
|
import {Link} from "react-router-dom";
|
||||||
|
|
||||||
|
export default function WalletItemCard({walletItem}) {
|
||||||
|
const [eth] = useState(90);
|
||||||
|
const [btc] = useState(85);
|
||||||
|
const [ltc] = useState(20);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col justify-between px-8 py-9"
|
||||||
|
style={{
|
||||||
|
background: `url(${background}) 0% 0% / cover no-repeat`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="wallet flex justify-between">
|
||||||
|
<div className="w-[100px] h-[100px] rounded-full bg-[#485199] flex justify-center items-center">
|
||||||
|
<div>
|
||||||
|
<p className="text-26 font-bold text-white tracking-wide text-center">
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
<p className="text-lg text-white tracking-wide text-center">
|
||||||
|
{walletItem.code}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{/*<p className="text-26 font-bold tracking-wide text-white text-right">*/}
|
||||||
|
{/* 6,572.00*/}
|
||||||
|
{/*</p>*/}
|
||||||
|
{/*<p className="tracking-wide text-white text-lg opacity-[70%]">*/}
|
||||||
|
{/* Total Transactions*/}
|
||||||
|
{/*</p>*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="balance">
|
||||||
|
<p className="text-lg text-white opacity-[70%] tracking-wide mb-6">
|
||||||
|
Current Balance
|
||||||
|
</p>
|
||||||
|
<p className="text-[44px] font-bold text-white tracking-wide leading-10 mb-2">
|
||||||
|
{walletItem.amount * 0.01} {walletItem.code}
|
||||||
|
</p>
|
||||||
|
<p className="text-lg text-white tracking-wide">
|
||||||
|
HOLDINGS : {PriceFormatter(walletItem.escrow * 0.01, walletItem.code)}
|
||||||
|
{/*<span className="text-light-green">(11.5%)</span>*/}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="counters flex space-x-16">
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
walletItem.action_type != 'AC_AD_FD_ONLY' ?
|
||||||
|
<Link to='transfer-fund' className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[40px] rounded-full relative bg-purple lg:text-xl text-lg font-bold text-white'>Transfer</Link>:''
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Link to='add-fund' state={{currency:walletItem.description}} className='px-2 py-1 flex items-center gap-2 user-balance cursor-pointer h-[40px] rounded-full relative bg-white lg:text-xl text-lg font-bold'>
|
||||||
|
<span className="">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="38"
|
||||||
|
height="38" viewBox="0 0 42 42" fill="none"><path
|
||||||
|
d="M21 0C16.8466 0 12.7865 1.23163 9.33303 3.53914C5.8796 5.84665 3.18798 9.1264 1.59854 12.9636C0.00909901 16.8009 -0.406771 21.0233 0.403518 25.0969C1.21381 29.1705 3.21386 32.9123 6.15077 35.8492C9.08767 38.7861 12.8295 40.7862 16.9031 41.5965C20.9767 42.4068 25.1991 41.9909 29.0364 40.4015C32.8736 38.812 36.1534 36.1204 38.4609 32.667C40.7684 29.2135 42 25.1534 42 21C41.994 15.4323 39.7796 10.0944 35.8426 6.15741C31.9056 2.22045 26.5677 0.00602189 21 0ZM28 22.75H22.75V28C22.75 28.4641 22.5656 28.9092 22.2374 29.2374C21.9093 29.5656 21.4641 29.75 21 29.75C20.5359 29.75 20.0908 29.5656 19.7626 29.2374C19.4344 28.9092 19.25 28.4641 19.25 28V22.75H14C13.5359 22.75 13.0908 22.5656 12.7626 22.2374C12.4344 21.9092 12.25 21.4641 12.25 21C12.25 20.5359 12.4344 20.0907 12.7626 19.7626C13.0908 19.4344 13.5359 19.25 14 19.25H19.25V14C19.25 13.5359 19.4344 13.0908 19.7626 12.7626C20.0908 12.4344 20.5359 12.25 21 12.25C21.4641 12.25 21.9093 12.4344 22.2374 12.7626C22.5656 13.0908 22.75 13.5359 22.75 14V19.25H28C28.4641 19.25 28.9093 19.4344 29.2374 19.7626C29.5656 20.0907 29.75 20.5359 29.75 21C29.75 21.4641 29.5656 21.9092 29.2374 22.2374C28.9093 22.5656 28.4641 22.75 28 22.75Z"
|
||||||
|
fill="white"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span className='text-black'>Add Credit</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -11,6 +11,11 @@ import ReferralTable from "../MyWallet/WalletComponent/ReferralTable";
|
|||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
ref_email: Yup.string()
|
ref_email: Yup.string()
|
||||||
.email("Wrong email format")
|
.email("Wrong email format")
|
||||||
|
.matches(
|
||||||
|
// /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
|
||||||
|
/^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/,
|
||||||
|
"Invalid email format"
|
||||||
|
)
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "Minimum 3 characters")
|
||||||
.max(50, "Maximum 50 characters")
|
.max(50, "Maximum 50 characters")
|
||||||
.required("Email is required"),
|
.required("Email is required"),
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ import * as Yup from "yup";
|
|||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
email: Yup.string()
|
email: Yup.string()
|
||||||
.email("Wrong email format")
|
.email("Wrong email format")
|
||||||
|
.matches(
|
||||||
|
// /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
|
||||||
|
/^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/,
|
||||||
|
"Invalid email format"
|
||||||
|
)
|
||||||
.min(3, "Minimum 3 characters")
|
.min(3, "Minimum 3 characters")
|
||||||
.max(50, "Maximum 50 characters")
|
.max(50, "Maximum 50 characters")
|
||||||
.required("Email is required"),
|
.required("Email is required"),
|
||||||
@@ -96,7 +101,7 @@ export default function PersonalInfoTab({
|
|||||||
// setRequestState({message: 'Profile update successfully', loading: false, status: true})
|
// setRequestState({message: 'Profile update successfully', loading: false, status: true})
|
||||||
toast.success("Update Successful");
|
toast.success("Update Successful");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
navigate("/", { replace: true });
|
// navigate("/", { replace: true });
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
|
|||||||
+9
-10
@@ -3,7 +3,9 @@
|
|||||||
font-family: "Product Sans";
|
font-family: "Product Sans";
|
||||||
src: url("./assets/fonts/Product Sans Regular.ttf");
|
src: url("./assets/fonts/Product Sans Regular.ttf");
|
||||||
}
|
}
|
||||||
|
.nft-main-container{
|
||||||
|
max-width: 1200px;
|
||||||
|
}
|
||||||
/* Bold Weight */
|
/* Bold Weight */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Product Sans";
|
font-family: "Product Sans";
|
||||||
@@ -25,14 +27,17 @@
|
|||||||
.heroSilderTitle{
|
.heroSilderTitle{
|
||||||
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
|
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
|
||||||
font-family: sans; color: white;
|
font-family: sans; color: white;
|
||||||
font-size: 42px;
|
|
||||||
font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;
|
font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
.back-dark1{
|
||||||
|
background-color: #193F5F;
|
||||||
|
min-width: 280px !important;
|
||||||
|
}
|
||||||
.job-action{
|
.job-action{
|
||||||
background-color: lightgoldenrodyellow;
|
background-color: aliceblue;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg_box{
|
.msg_box{
|
||||||
@@ -46,13 +51,7 @@
|
|||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.siderCardHeader{
|
|
||||||
margin: 40px 40px 10px 40px;
|
|
||||||
font-size: 24px;
|
|
||||||
font-weight: bolder;
|
|
||||||
}
|
|
||||||
.siderCardDescription{
|
.siderCardDescription{
|
||||||
margin: 10px 45px 10px 45px;
|
|
||||||
background-color: aliceblue;
|
background-color: aliceblue;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
const { jobListTable } = useSelector((state) => state.tableReload);
|
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||||
|
|
||||||
const { userDetails:{loggedIn} } = useSelector((state) => state?.userDetails); // CHECKS IF LOGGEDIN IS TRUE
|
const { userDetails:{username, uid} } = useSelector((state) => state?.userDetails); // CHECKS IF USER Details are avaliable, to determine if user is active
|
||||||
|
|
||||||
|
let loggedIn = username && uid ? true : false // variable to determine if user is logged in
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
//Removing Data stored at localStorage after session expires
|
//Removing Data stored at localStorage after session expires
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
|
|
||||||
class usersService {
|
class usersService {
|
||||||
@@ -11,6 +10,10 @@ class usersService {
|
|||||||
return this.postAuxEnd("/createuser", reqData);
|
return this.postAuxEnd("/createuser", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompleteOauthLogin(reqData) {
|
||||||
|
localStorage.setItem("session_token", ``);
|
||||||
|
return this.postAuxEnd("/authlogin", reqData);
|
||||||
|
}
|
||||||
CompleteSignUp(reqData) {
|
CompleteSignUp(reqData) {
|
||||||
localStorage.setItem("session_token", ``);
|
localStorage.setItem("session_token", ``);
|
||||||
return this.postAuxEnd("/completesignuplink", reqData);
|
return this.postAuxEnd("/completesignuplink", reqData);
|
||||||
@@ -26,10 +29,22 @@ class usersService {
|
|||||||
};
|
};
|
||||||
return this.postAuxEnd("/dashdata", postData);
|
return this.postAuxEnd("/dashdata", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
logInUser(reqData) {
|
logInUser(reqData) {
|
||||||
localStorage.setItem("session_token", ``);
|
localStorage.setItem("session_token", ``);
|
||||||
return this.postAuxEnd("/userlogin", reqData);
|
return this.postAuxEnd("/userlogin", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authStart(reqData) {
|
||||||
|
localStorage.setItem("session_token", ``);
|
||||||
|
return this.postAuxEnd("/authstart", reqData);
|
||||||
|
}
|
||||||
|
|
||||||
|
authLogin(reqData) {
|
||||||
|
localStorage.setItem("session_token", ``);
|
||||||
|
return this.postAuxEnd("/authlogin", reqData);
|
||||||
|
}
|
||||||
|
|
||||||
marketJobData(reqData) {
|
marketJobData(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
uuid: localStorage.getItem("uuid"),
|
uuid: localStorage.getItem("uuid"),
|
||||||
@@ -838,6 +853,27 @@ class usersService {
|
|||||||
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
return this.postAuxEnd("/offerinterestlistmsg", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TO ADD FAMILY
|
||||||
|
addFamily(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/familyadd", postData);
|
||||||
|
}
|
||||||
|
|
||||||
|
familyListings(reqData) {
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
...reqData,
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/familylist", postData);
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION TO ASSIGN TASK TO FAMILY MEMBER
|
// FUNCTION TO ASSIGN TASK TO FAMILY MEMBER
|
||||||
assignFamilyTask(reqData) {
|
assignFamilyTask(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import FamilyAcc from "../components/FamilyAcc";
|
import FamilyAcc from "../components/FamilyAcc";
|
||||||
|
|
||||||
export default function FamilyAccPage() {
|
export default function FamilyAccPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FamilyAcc />
|
<FamilyAcc />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user