Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d05da30ca | |||
| 6e97121f96 | |||
| d78c30d9b5 | |||
| 6be6d5cecd | |||
| 997985a45d | |||
| 630b32e78d | |||
| 837d68f3a1 | |||
| 0a2c4b86f3 | |||
| e7a46c25c1 | |||
| 8e9ae8187f | |||
| b25a9c154b | |||
| 66bfe4be82 | |||
| 02773ed1da | |||
| e6c02468de | |||
| 58a75a1c89 | |||
| 8a5b784381 | |||
| 883a98951a | |||
| 7aaae11993 | |||
| ccebe37c34 | |||
| df90d1eea5 | |||
| 45d6220054 | |||
| 95a89c1ccc |
@@ -23,7 +23,7 @@ REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
|||||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=1800000
|
||||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||||
|
|
||||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
|||||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=1800000
|
||||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||||
|
|
||||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ REACT_APP_PRIMARY_SOCKET="https://socket.wrenchboard.com"
|
|||||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=1800000
|
||||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||||
|
|
||||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||||
|
|||||||
+3
-28
@@ -3,10 +3,9 @@ import { lazy } from "react";
|
|||||||
|
|
||||||
import LoginLandingPage from './views/LoginLandingPage'
|
import LoginLandingPage from './views/LoginLandingPage'
|
||||||
import LoginPage from "./views/LoginPage";
|
import LoginPage from "./views/LoginPage";
|
||||||
import HomePages from "./views/HomePages";
|
|
||||||
import SocketConnection from "./middleware/SocketConnection";
|
import SocketConnection from "./middleware/SocketConnection";
|
||||||
|
|
||||||
|
const HomePages = lazy(() => import("./views/HomePages"));
|
||||||
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
||||||
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
||||||
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
||||||
@@ -17,8 +16,6 @@ const AppleRedirectPage = lazy(() => import("./views/AppleRedirectPage"));
|
|||||||
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
||||||
const AuthRedirect = lazy(() => import("./views/AuthRedirect"));
|
const AuthRedirect = lazy(() => import("./views/AuthRedirect"));
|
||||||
const BlogPage = lazy(() => import("./views/BlogPage"));
|
const BlogPage = lazy(() => import("./views/BlogPage"));
|
||||||
const CalendarPage = lazy(() => import("./views/CalendarPage"));
|
|
||||||
const CollectionItemPage = lazy(() => import("./views/CollectionItemPage"));
|
|
||||||
const FacebookRedirect = lazy(() => import("./views/FacebookRedirect"));
|
const FacebookRedirect = lazy(() => import("./views/FacebookRedirect"));
|
||||||
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
||||||
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
||||||
@@ -45,8 +42,6 @@ const OffersInterestPage = lazy(()=> import("./views/OffersInterestPage"));
|
|||||||
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
||||||
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
||||||
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
||||||
const SavedPage = lazy(()=> import("./views/SavedPage"));
|
|
||||||
const SellPage = lazy(()=> import("./views/SellPage"));
|
|
||||||
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
||||||
const SignupPage = lazy(()=> import("./views/SignupPage"));
|
const SignupPage = lazy(()=> import("./views/SignupPage"));
|
||||||
const SignupPageTwo = lazy(()=> import("./views/SignupPageTwo"));
|
const SignupPageTwo = lazy(()=> import("./views/SignupPageTwo"));
|
||||||
@@ -80,7 +75,7 @@ export default function Routers() {
|
|||||||
<ScrollToTop>
|
<ScrollToTop>
|
||||||
<Routes>
|
<Routes>
|
||||||
{/* guest routes */}
|
{/* guest routes */}
|
||||||
{process.env.REACT_APP_NEW_LOGIN_LAYOUT == 1 ? (
|
{Number(process.env.REACT_APP_NEW_LOGIN_LAYOUT) === 1 ? (
|
||||||
<>
|
<>
|
||||||
<Route exact path="/login" element={<LoginLandingPage />} />
|
<Route exact path="/login" element={<LoginLandingPage />} />
|
||||||
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
||||||
@@ -99,7 +94,7 @@ export default function Routers() {
|
|||||||
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
||||||
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
||||||
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
||||||
<Route exact path="/invite" element={<LoginPageTwo />} />
|
<Route exact path="/invite" element={<SignupPageTwo />} />
|
||||||
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@@ -133,14 +128,8 @@ export default function Routers() {
|
|||||||
<Route element={<SocketConnection />}>
|
<Route element={<SocketConnection />}>
|
||||||
<Route element={<AuthRoute />}>
|
<Route element={<AuthRoute />}>
|
||||||
<Route exact path="/" element={<HomePages />} />
|
<Route exact path="/" element={<HomePages />} />
|
||||||
{/* <Route exact path="/active-bids" element={<AcitveBidsPage />} />
|
|
||||||
<Route exact path="/notification" element={<Notification />} />
|
|
||||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
|
||||||
<Route exact path="/shop-details" element={<ShopDetailsPage />} />
|
|
||||||
<Route exact path="/my-collection" element={<MyCollection />} />*/}
|
|
||||||
<Route exact path="/reminders" element={<RemindersPage />} />
|
<Route exact path="/reminders" element={<RemindersPage />} />
|
||||||
<Route exact path="/tracking" element={<TrackingPage />} />
|
<Route exact path="/tracking" element={<TrackingPage />} />
|
||||||
<Route exact path="/calendar" element={<CalendarPage />} />
|
|
||||||
<Route exact path="/resources" element={<ResourcePage />} />
|
<Route exact path="/resources" element={<ResourcePage />} />
|
||||||
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
||||||
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
||||||
@@ -163,7 +152,6 @@ export default function Routers() {
|
|||||||
<Route exact path="/notification" element={<Notification />} />
|
<Route exact path="/notification" element={<Notification />} />
|
||||||
<Route exact path="/mytask" element={<MyTaskPage />} />
|
<Route exact path="/mytask" element={<MyTaskPage />} />
|
||||||
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
<Route exact path="/myjobs" element={<MyJobsPage />} />
|
||||||
{/* <Route exact path="/add-job" element={<AddJobPage />} /> */}
|
|
||||||
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
<Route exact path="/my-active-jobs" element={<MyActiveJobsPage />} />
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
@@ -177,10 +165,6 @@ export default function Routers() {
|
|||||||
path="/my-review-jobs"
|
path="/my-review-jobs"
|
||||||
element={<MyReviewDueJobsPage />}
|
element={<MyReviewDueJobsPage />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <Route exact path='/acc-family' element={<FamilyAccPage />} />
|
|
||||||
<Route exact path="/acc-family/activities" element={<FamilyActivitiesPage />} />
|
|
||||||
<Route exact path="/acc-family/familysettings" element={<FamilySettingsPage />} /> */}
|
|
||||||
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
||||||
|
|
||||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||||
@@ -202,17 +186,8 @@ export default function Routers() {
|
|||||||
path="/manage-offer"
|
path="/manage-offer"
|
||||||
element={<ManageInterestOfferPage />}
|
element={<ManageInterestOfferPage />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
|
||||||
exact
|
|
||||||
path="/my-collection/collection-item"
|
|
||||||
element={<CollectionItemPage />}
|
|
||||||
/>
|
|
||||||
<Route exact path="/sell" element={<SellPage />} />
|
|
||||||
<Route exact path="/saved" element={<SavedPage />} />
|
|
||||||
<Route exact path="/history" element={<HistoryPage />} />
|
<Route exact path="/history" element={<HistoryPage />} />
|
||||||
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
||||||
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
|
|
||||||
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
||||||
<Route exact path="/profile" element={<AuthProfilePage />} />
|
<Route exact path="/profile" element={<AuthProfilePage />} />
|
||||||
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import WrenchBoard from "../../assets/images/wrenchboard-logo-text.png";
|
|||||||
|
|
||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
|
|
||||||
export default function LoginLayout({ slogan, children }) {
|
export default function AuthLayout2({ slogan, children }) {
|
||||||
// const bgImg = localImgLoad("images/left-wrenchboard.jpg");
|
// const bgImg = localImgLoad("images/left-wrenchboard.jpg");
|
||||||
const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg");
|
const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg");
|
||||||
const bgImgCom = localImgLoad("images/wrench-home-back-common.jpg");
|
const bgImgCom = localImgLoad("images/wrench-home-back-common.jpg");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout2";
|
|||||||
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
export default function SignUp() {
|
export default function SignUp({details}) {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
@@ -28,9 +28,9 @@ export default function SignUp() {
|
|||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
country: country ? country : "",
|
country: country ? country : "",
|
||||||
first_name: "",
|
first_name: details ? details.first_name : "",
|
||||||
last_name: "",
|
last_name: details ? details.last_name : "",
|
||||||
email: "",
|
email: details ? details.email : "",
|
||||||
password: "",
|
password: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -202,6 +202,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.first_name}
|
value={formData.first_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.first_name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item flex-1">
|
<div className="input-item flex-1">
|
||||||
@@ -213,6 +214,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.last_name}
|
value={formData.last_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.last_name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -225,6 +227,7 @@ export default function SignUp() {
|
|||||||
type="email"
|
type="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.email}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item mb-4">
|
<div className="input-item mb-4">
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
let {message} = data
|
let {message} = data
|
||||||
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child account when parent assigns a job
|
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child account when parent assigns a job
|
||||||
dispatch(tableReload({type:'FAMILYOFFERLIST'})) // dispatches to update family pending/offer list on family side
|
dispatch(tableReload({type:'FAMILYOFFERLIST'})) // dispatches to update family pending/offer list on family side
|
||||||
|
dispatch(tableReload({ type: "FAMILYBANNERSLIST" })) // dispatches to update family banner list on family side
|
||||||
}
|
}
|
||||||
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
|
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
|
||||||
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
||||||
|
|||||||
@@ -8,16 +8,13 @@ import { tableReload } from "../../store/TableReloads";
|
|||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import HomeModal from "./HomeModal";
|
import HomeModal from "./HomeModal";
|
||||||
|
|
||||||
export default function FamilyDash({ MyActiveJobList=[], serverImg }) {
|
export default function FamilyDash() {
|
||||||
// console.log("PROPS IN FAMILY DASH->", familyOffers?.result_list);
|
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [firstTimeModal, setFirstTimeModal] = useState(true)
|
const [firstTimeModal, setFirstTimeModal] = useState(true)
|
||||||
|
|
||||||
const userApi = new usersService();
|
const userApi = new usersService();
|
||||||
|
|
||||||
// const trending = MyActiveJobList;
|
|
||||||
|
|
||||||
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
||||||
|
|
||||||
@@ -25,21 +22,21 @@ export default function FamilyDash({ MyActiveJobList=[], serverImg }) {
|
|||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
let [reloadBanner, setReloadBanner] = useState(0)
|
// let [reloadBanner, setReloadBanner] = useState(0)
|
||||||
|
|
||||||
useEffect(()=>{
|
// useEffect(()=>{
|
||||||
if(reloadBanner >= 2){
|
// if(reloadBanner >= 2){
|
||||||
dispatch(tableReload({ type: "FAMILYBANNERSLIST" })); // RELOAD FAMILY BANNERS LIST EVERY 10 MINS
|
// dispatch(tableReload({ type: "FAMILYBANNERSLIST" })); // RELOAD FAMILY BANNERS LIST EVERY 10 MINS
|
||||||
setReloadBanner(0)
|
// setReloadBanner(0)
|
||||||
}
|
// }
|
||||||
const timer = setInterval(()=>{
|
// const timer = setInterval(()=>{
|
||||||
setReloadBanner(prev => prev+1)
|
// setReloadBanner(prev => prev+1)
|
||||||
},300000)
|
// },300000)
|
||||||
|
|
||||||
return ()=>{
|
// return ()=>{
|
||||||
clearInterval(timer)
|
// clearInterval(timer)
|
||||||
}
|
// }
|
||||||
},[reloadBanner])
|
// },[reloadBanner])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -2,124 +2,53 @@ import React, { useState, useEffect } from "react";
|
|||||||
import datas from "../../data/product_data.json";
|
import datas from "../../data/product_data.json";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import FamilyDash from "./FamilyDash";
|
import FamilyDash from "./FamilyDash";
|
||||||
import FullAccountDash from "./FullAccountDash";
|
import FullAccountDash from "./FullAccountDash";
|
||||||
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
|
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
export default function Home(props) {
|
export default function Home(props) {
|
||||||
// console.log("PROPS IN HOME->", props);
|
|
||||||
const userApi = new usersService();
|
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
// const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS
|
useEffect(()=>{
|
||||||
|
if(!commonHeadBanner.loading && (!commonHeadBanner?.data || Object.keys(commonHeadBanner?.data).length < 1)){
|
||||||
// const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST
|
dispatch(tableReload({ type: "HOMEBANNERS" })); // reloads home banner in case it fails to load or encounters error while loading
|
||||||
// try {
|
}
|
||||||
// const res = await userApi.getMyActiveTaskList();
|
},[])
|
||||||
// setMyActiveJobList({loading:false, data:res?.data?.result_list});
|
|
||||||
// // setMyActiveJobList(res?.data?.result_list);
|
|
||||||
// } catch (error) {
|
|
||||||
// setMyActiveJobList({loading:false, data:[]});
|
|
||||||
// // setMyActiveJobList([]);
|
|
||||||
// console.log("Error getting tasks");
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME
|
|
||||||
// const getHomeDate = () => {
|
|
||||||
// userApi
|
|
||||||
// .getHomeDate()
|
|
||||||
// .then((res) => {
|
|
||||||
// if (res.status != 200 || res.internal_return < 0) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// setNextDueTask(res.data);
|
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// console.log(error);
|
|
||||||
// });
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const getMyOffersList = async () => {
|
|
||||||
// try {
|
|
||||||
// const res = await userApi.getOffersList();
|
|
||||||
// setMyOffersList({loading:false, data:res.data});
|
|
||||||
// } catch (error) {
|
|
||||||
// setMyOffersList({loading:false, data:[]});
|
|
||||||
// console.log("Error getting offers", error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if(userDetails?.account_type == 'FULL'){
|
|
||||||
// getMyActiveJobList();
|
|
||||||
// }
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
{/* {Object.keys(commonHeadBanner).length < 1 ?
|
|
||||||
<LoadingSpinner height='h-48' size='16' />
|
|
||||||
:
|
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
|
<>
|
||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
||||||
<FamilyDash
|
<FamilyDash
|
||||||
account={userDetails}
|
account={userDetails}
|
||||||
commonHeadData={props.bannerList}
|
|
||||||
// familyOffers={MyOffersList?.data}
|
|
||||||
serverImg = {userDetails?.session_image_server}
|
|
||||||
// MyActiveJobList={MyActiveJobList?.data}
|
|
||||||
/>
|
/>
|
||||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
) : userDetails && userDetails?.account_type == "FULL" ? (
|
||||||
<FullAccountDash
|
<>
|
||||||
bannerList={props.bannerList}
|
{commonHeadBanner.loading ?
|
||||||
dashTypes={props.dashTypes}
|
<LoadingSpinner height='h-48' size='16' />
|
||||||
// offersList={MyOffersList}
|
:
|
||||||
// MyActiveJobList={MyActiveJobList}
|
<FullAccountDash
|
||||||
offersList={props.offersList}
|
bannerList={commonHeadBanner?.data?.result_list}
|
||||||
imageServer={props.imageServer}
|
dashTypes={commonHeadBanner?.data?.home_dash_type}
|
||||||
/>
|
offersList={commonHeadBanner?.data?.offers_list}
|
||||||
|
imageServer={commonHeadBanner?.data?.session_image_server}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
You are not logged in or your account type is not supported.
|
You are not logged in or your account type is not supported.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
</div>
|
</div>
|
||||||
} */}
|
|
||||||
|
|
||||||
<div className="w-full">
|
|
||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
|
||||||
<FamilyDash
|
|
||||||
account={userDetails}
|
|
||||||
commonHeadData={props.bannerList}
|
|
||||||
// familyOffers={MyOffersList?.data}
|
|
||||||
serverImg = {userDetails?.session_image_server}
|
|
||||||
// MyActiveJobList={MyActiveJobList?.data}
|
|
||||||
/>
|
|
||||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
|
||||||
<>
|
|
||||||
{Object.keys(commonHeadBanner).length < 1 ?
|
|
||||||
<LoadingSpinner height='h-48' size='16' />
|
|
||||||
:
|
|
||||||
<FullAccountDash
|
|
||||||
bannerList={props.bannerList}
|
|
||||||
dashTypes={props.dashTypes}
|
|
||||||
// offersList={MyOffersList}
|
|
||||||
// MyActiveJobList={MyActiveJobList}
|
|
||||||
offersList={props.offersList}
|
|
||||||
imageServer={props.imageServer}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<div>
|
|
||||||
You are not logged in or your account type is not supported.
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
||||||
|
import NairaWithdraw from "./Popup/NairaWithdraw";
|
||||||
|
import ViewVirtualCardPopout from "./walletvirtual/ViewVirtualCardPopout";
|
||||||
|
import WalletExtraActionBtn from "./WalletExtraActionBtn";
|
||||||
|
|
||||||
|
function VirtualCardAction({ walletItem, payment }) {
|
||||||
|
|
||||||
|
// virtual add card popout
|
||||||
|
const [popup, setPopup] = useState({ show: false, name: '', data: {} });
|
||||||
|
|
||||||
|
/*OPENS the virtual add card popout*/
|
||||||
|
const openPopUp = (name, value) => {
|
||||||
|
setPopup({
|
||||||
|
show: true,
|
||||||
|
name: name,
|
||||||
|
data: { ...value },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Closes the virtual add card popout*/
|
||||||
|
const closePopUp = () => {
|
||||||
|
setPopup({ show: false, name: '', data: {} });
|
||||||
|
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="counters w-full flex justify-end gap-2">
|
||||||
|
|
||||||
|
{/* EXTRA ACTIONS BTN */}
|
||||||
|
<div className="w-1/2 flex justify-end items-center">
|
||||||
|
<button
|
||||||
|
className="logout-btn btn-gradient text-white"
|
||||||
|
onClick={() => {
|
||||||
|
openPopUp('view_card',{
|
||||||
|
payment: payment,
|
||||||
|
currency: walletItem?.description,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
View Card
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* VIRTUAL CARD POPOUT */}
|
||||||
|
{(popup.show && popup.name=='view_card') && (
|
||||||
|
<ViewVirtualCardPopout
|
||||||
|
details={popup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closePopUp}
|
||||||
|
situation={popup.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default VirtualCardAction;
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useSelector } from "react-redux";
|
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletItemCard from "./WalletItemCard";
|
import WalletItemCard from "./WalletItemCard";
|
||||||
import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual'
|
import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
|
* Renders a list of wallet items or a loading spinner depending on the state of the `wallet` object.
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ function ReferralTable({ history }) {
|
|||||||
currentReferral.map((item, index) => (
|
currentReferral.map((item, index) => (
|
||||||
<tr key={index} className="text-slate-500">
|
<tr key={index} className="text-slate-500">
|
||||||
<td className="p-3">
|
<td className="p-3">
|
||||||
{item.added_date} / {item.firstname} {item.lastname}
|
<div style={{flexDirection: "column"}} >
|
||||||
|
<div style={{color: "blue"}}>{item.added_date} </div>
|
||||||
|
<div>{item.firstname} {item.lastname}</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3">{item.email}</td>
|
<td className="p-3">{item.email}</td>
|
||||||
<td className="p-3">{item.status}</td>
|
<td className="p-3">{item.status}</td>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
// import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
|
// import background from "../../assets/images/bg-sky-blue.jpg"; //shape/balance-bg.svg";
|
||||||
import localImgLoad from "../../lib/localImgLoad";
|
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import CreditPopup from "./Popup/CreditPopup";
|
import CreditPopup from "./Popup/CreditPopup";
|
||||||
import WalletAction from "./WalletAction";
|
import WalletAction from "./WalletAction";
|
||||||
|
import VirtualCardAction from "./VirtualCardAction";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders a card displaying information about a wallet item.
|
* Renders a card displaying information about a wallet item.
|
||||||
@@ -59,7 +59,7 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
</div> */}
|
</div> */}
|
||||||
<div className="balance w-full mt-2 flex justify-end">
|
<div className="balance w-full mt-2 flex justify-end">
|
||||||
<div className="flex flex-col items-center">
|
<div className="flex flex-col items-center">
|
||||||
<p className="text-base sm:text-lg text-white tracking-wide mb-2 sm:mb-6">
|
<p className={`${(walletItem?.brand && walletItem?.card_last4) && 'hidden' } text-base sm:text-lg text-white tracking-wide mb-2 sm:mb-6`}>
|
||||||
Current Balance
|
Current Balance
|
||||||
</p>
|
</p>
|
||||||
{walletItem?.brand && walletItem?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
{walletItem?.brand && walletItem?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
||||||
@@ -80,7 +80,7 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{walletItem.escrow > 0 ?
|
{walletItem.escrow > 0 & (!walletItem?.brand && !walletItem?.card_last4 ) ?
|
||||||
<div className='w-full flex justify-end'>
|
<div className='w-full flex justify-end'>
|
||||||
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||||
HOLDINGS :{" "}
|
HOLDINGS :{" "}
|
||||||
@@ -98,6 +98,7 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{(!walletItem?.brand || !walletItem?.card_last4) ?
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||||
<WalletAction
|
<WalletAction
|
||||||
@@ -106,6 +107,16 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
openPopUp={openPopUp}
|
openPopUp={openPopUp}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
:
|
||||||
|
<div className='w-full'>
|
||||||
|
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||||
|
<VirtualCardAction
|
||||||
|
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||||
|
payment={payment}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{creditPopup.show && (
|
{creditPopup.show && (
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { Form, Formik } from "formik";
|
||||||
|
import * as Yup from "yup";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import CustomTimer from "../../countdown/CustomTimer";
|
||||||
|
import InputCom from '../../Helpers/Inputs/InputCom'
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
|
||||||
|
|
||||||
|
const validationSchema = Yup.object().shape({
|
||||||
|
|
||||||
|
country: Yup.string()
|
||||||
|
.required("Required"),
|
||||||
|
phone_number: Yup.string()
|
||||||
|
.min(9, "Invalid")
|
||||||
|
.max(11, "Invalid")
|
||||||
|
.required("Required"),
|
||||||
|
address: Yup.string()
|
||||||
|
.min(5, "Min 3 characters")
|
||||||
|
.max(50, "Max 25 characters")
|
||||||
|
.required("Required"),
|
||||||
|
city: Yup.string()
|
||||||
|
.min(2, "Min 3 characters")
|
||||||
|
.max(25, "Max 25 characters")
|
||||||
|
.required("Required"),
|
||||||
|
state: Yup.string()
|
||||||
|
.required("Required"),
|
||||||
|
zipCode: Yup.string()
|
||||||
|
.min(1, "Min 3 characters")
|
||||||
|
.max(8, "Max 8 characters")
|
||||||
|
.required("Required"),
|
||||||
|
dob: Yup.string()
|
||||||
|
.required("Required"),
|
||||||
|
checked: Yup.bool() // use bool instead of boolean
|
||||||
|
.oneOf([true], "You must accept the terms and conditions")
|
||||||
|
});
|
||||||
|
|
||||||
|
const ViewVirtualCardPopout = ({ details, onClose, situation, walletItem }) => {
|
||||||
|
|
||||||
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
|
const countryCode = walletItem?.country
|
||||||
|
|
||||||
|
const userApi = new usersService()
|
||||||
|
|
||||||
|
const [requestStatus, setRequestStatus] = useState({loading: false, status:false, message: ''})
|
||||||
|
|
||||||
|
let initialValues = {
|
||||||
|
// initial values for formik
|
||||||
|
country: countryCode ? countryCode : '',
|
||||||
|
phone_number: '',
|
||||||
|
email: userDetails?.email,
|
||||||
|
firstname: userDetails?.firstname,
|
||||||
|
lastname: userDetails?.lastname,
|
||||||
|
birthYear: '',
|
||||||
|
birthMonth: '',
|
||||||
|
birthDay: '',
|
||||||
|
address: '',
|
||||||
|
city: userDetails?.city ? userDetails.city : '',
|
||||||
|
state: '',
|
||||||
|
zipCode: '',
|
||||||
|
dob: '',
|
||||||
|
checked: false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const handleSubmit = (values) => {
|
||||||
|
let date = new Date(values.dob)
|
||||||
|
const reqData = {
|
||||||
|
request_type: '100',
|
||||||
|
address: values.address,
|
||||||
|
city: values.city,
|
||||||
|
state: values.state,
|
||||||
|
country: values.country,
|
||||||
|
postal_code: values.zipCode,
|
||||||
|
phone_number: values.phone_number,
|
||||||
|
// dob_day: values.birthDay,
|
||||||
|
// dob_month: values.birthMonth,
|
||||||
|
// dob_year: values.birthYear,
|
||||||
|
dob_day: Number(date.getDate()),
|
||||||
|
dob_month: Number(date.getMonth()) + 1,
|
||||||
|
dob_year: Number(date.getFullYear()),
|
||||||
|
dob: values.dob
|
||||||
|
}
|
||||||
|
// console.log('Values', reqData)
|
||||||
|
setRequestStatus({loading: true, status:false, message: ''})
|
||||||
|
userApi.walletCardRequest(reqData).then(res => {
|
||||||
|
if(res?.data?.internal_return < 0){
|
||||||
|
setRequestStatus({loading: false, status:false, message: 'Failed, try again'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:true, message: ''})
|
||||||
|
},4000)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setRequestStatus({loading: false, status:true, message: 'Successful'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:true, message: ''})
|
||||||
|
onClose()
|
||||||
|
},4000)
|
||||||
|
}).catch(err => {
|
||||||
|
console.log('ERR', err)
|
||||||
|
setRequestStatus({loading: false, status:false, message: 'Unable to complete'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setRequestStatus({loading: false, status:false, message: ''})
|
||||||
|
},4000)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
// Get Country Api
|
||||||
|
console.log('ok')
|
||||||
|
},[])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom
|
||||||
|
action={onClose}
|
||||||
|
situation={situation}
|
||||||
|
>
|
||||||
|
<Formik
|
||||||
|
initialValues={initialValues}
|
||||||
|
validationSchema={validationSchema}
|
||||||
|
onSubmit={handleSubmit}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<div className="logout-modal-wrapper mx-auto w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<Form className="w-full">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
{walletItem?.description}
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={onClose}
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
viewBox="0 0 36 36"
|
||||||
|
fill="none"
|
||||||
|
className="fill-current"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M36 16.16C36 17.4399 36 18.7199 36 20.0001C35.7911 20.0709 35.8636 20.2554 35.8385 20.4001C34.5321 27.9453 30.246 32.9248 22.9603 35.2822C21.9006 35.6251 20.7753 35.7657 19.6802 35.9997C18.4003 35.9997 17.1204 35.9997 15.8401 35.9997C15.5896 35.7086 15.2189 35.7732 14.9034 35.7093C7.77231 34.2621 3.08728 30.0725 0.769671 23.187C0.435002 22.1926 0.445997 21.1199 0 20.1599C0 18.7198 0 17.2798 0 15.8398C0.291376 15.6195 0.214408 15.2656 0.270759 14.9808C1.71321 7.69774 6.02611 2.99691 13.0428 0.700951C14.0118 0.383805 15.0509 0.386897 15.9999 0C17.2265 0 18.4532 0 19.6799 0C19.7156 0.124041 19.8125 0.136067 19.9225 0.146719C27.3 0.868973 33.5322 6.21922 35.3801 13.427C35.6121 14.3313 35.7945 15.2484 36 16.16ZM33.011 18.0787C33.0433 9.77105 26.3423 3.00309 18.077 2.9945C9.78479 2.98626 3.00344 9.658 2.98523 17.8426C2.96667 26.1633 9.58859 32.9601 17.7602 33.0079C26.197 33.0577 32.9787 26.4186 33.011 18.0787Z"
|
||||||
|
fill=""
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M15.9309 18.023C13.9329 16.037 12.007 14.1207 10.0787 12.2072C9.60071 11.733 9.26398 11.2162 9.51996 10.506C9.945 9.32677 11.1954 9.0811 12.1437 10.0174C13.9067 11.7585 15.6766 13.494 17.385 15.2879C17.9108 15.8401 18.1633 15.7487 18.6375 15.258C20.3586 13.4761 22.1199 11.7327 23.8822 9.99096C24.8175 9.06632 26.1095 9.33639 26.4967 10.517C26.7286 11.2241 26.3919 11.7413 25.9133 12.2178C24.1757 13.9472 22.4477 15.6855 20.7104 17.4148C20.5228 17.6018 20.2964 17.7495 20.0466 17.9485C22.0831 19.974 24.0372 21.8992 25.9689 23.8468C26.9262 24.8119 26.6489 26.1101 25.4336 26.4987C24.712 26.7292 24.2131 26.3441 23.7455 25.8757C21.9945 24.1227 20.2232 22.3892 18.5045 20.6049C18.0698 20.1534 17.8716 20.2269 17.4802 20.6282C15.732 22.4215 13.9493 24.1807 12.1777 25.951C11.7022 26.4262 11.193 26.7471 10.4738 26.4537C9.31345 25.9798 9.06881 24.8398 9.98589 23.8952C11.285 22.5576 12.6138 21.2484 13.9387 19.9355C14.5792 19.3005 15.2399 18.6852 15.9309 18.023Z"
|
||||||
|
fill="#"
|
||||||
|
fillOpacity="0.6"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className='h-[22rem]'></div>
|
||||||
|
{requestStatus.message &&
|
||||||
|
<div className='px-4 my-1'>
|
||||||
|
<p className={`text-center text-base py-1 font-bold ${requestStatus.status ? 'bg-emerald-600 text-white' : 'bg-red-100 text-red-600'}`}>{requestStatus.message}</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div className="modal-footer-wrapper grid grid-cols-1 xxs:grid-cols-3">
|
||||||
|
<div className="w-full col-span-1 xxs:col-span-2 xxs:col-start-2 flex justify-between items-center">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onClose}
|
||||||
|
className="custom-btn bg-[#f5a430] text-black text-base"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<>
|
||||||
|
{requestStatus.loading ?
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
|
disabled={requestStatus.loading || requestStatus.status}
|
||||||
|
>
|
||||||
|
Continue
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Formik>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ViewVirtualCardPopout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const day = new Array(31).fill(0).map((_,i) => i+1 )
|
||||||
|
|
||||||
|
const month = [
|
||||||
|
{value: 1, name: 'January'},
|
||||||
|
{value: 2, name: 'February'},
|
||||||
|
{value: 3, name: 'March'},
|
||||||
|
{value: 4, name: 'April'},
|
||||||
|
{value: 5, name: 'May'},
|
||||||
|
{value: 6, name: 'June'},
|
||||||
|
{value: 7, name: 'July'},
|
||||||
|
{value: 8, name: 'August'},
|
||||||
|
{value: 9, name: 'September'},
|
||||||
|
{value: 10, name: 'October'},
|
||||||
|
{value: 11, name: 'November'},
|
||||||
|
{value: 12, name: 'December'},
|
||||||
|
]
|
||||||
|
|
||||||
|
const date = new Date().getFullYear()
|
||||||
|
|
||||||
|
const year = new Array(100).fill(0).map((_,i) => (date-2) - i+1 )
|
||||||
@@ -6,6 +6,8 @@ import axios from 'axios'
|
|||||||
function Default({ children }) {
|
function Default({ children }) {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
|
||||||
|
const [nocache, setNoCache] = useState(false) // holds cache/nocache value
|
||||||
|
|
||||||
// dark mode setup
|
// dark mode setup
|
||||||
const [theme, setTheme] = useState(null);
|
const [theme, setTheme] = useState(null);
|
||||||
|
|
||||||
@@ -16,6 +18,10 @@ function Default({ children }) {
|
|||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
|
const handleThemeSwitch = () => {
|
||||||
|
setTheme(theme === "dark" ? "light" : "dark");
|
||||||
|
};
|
||||||
|
|
||||||
const getLocation = () => {
|
const getLocation = () => {
|
||||||
if (navigator.geolocation) {
|
if (navigator.geolocation) {
|
||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
@@ -58,10 +64,6 @@ function Default({ children }) {
|
|||||||
}
|
}
|
||||||
}, [theme]);
|
}, [theme]);
|
||||||
|
|
||||||
const handleThemeSwitch = () => {
|
|
||||||
setTheme(theme === "dark" ? "light" : "dark");
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(country){
|
if(country){
|
||||||
setCountryMode(country)
|
setCountryMode(country)
|
||||||
@@ -75,7 +77,7 @@ function Default({ children }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode }}>
|
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode, nocache, setNoCache }}>
|
||||||
{children && children}
|
{children && children}
|
||||||
</DarkModeContext.Provider>
|
</DarkModeContext.Provider>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { toast } from "react-toastify";
|
// import { toast } from "react-toastify";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
@@ -74,7 +74,7 @@ function ReferralDisplay() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//FUNCTION TO SEND REFERRAL MESSAGE
|
//FUNCTION TO SEND REFERRAL MESSAGE
|
||||||
const sendReferralMsg = (postData) => {
|
const sendReferralMsg = (postData, helpers) => {
|
||||||
apiCall
|
apiCall
|
||||||
.sendReferralMsg(postData)
|
.sendReferralMsg(postData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -84,11 +84,17 @@ function ReferralDisplay() {
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
return;
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: false });
|
||||||
|
},3000)
|
||||||
} else {
|
} else {
|
||||||
toast.success(res.data.status | "Message Sent!");
|
// toast.success(res.data.status | "Message Sent!");
|
||||||
setError({ message: "", loading: false, status: true });
|
setError({ message: res.data.status, loading: false, status: true });
|
||||||
|
helpers.resetForm() // resets the form data
|
||||||
setRefHistoryReload((prev) => !prev);
|
setRefHistoryReload((prev) => !prev);
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: true });
|
||||||
|
},3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -97,13 +103,16 @@ function ReferralDisplay() {
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: false });
|
||||||
|
},3000)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = (values, helpers) => {
|
const handleSubmit = (values, helpers) => {
|
||||||
setError({ message: "", loading: true, status: false });
|
setError({ message: "", loading: true, status: false });
|
||||||
sendReferralMsg({...values}); // FUNCTION TO SEND REFERRAL MESSAGE
|
sendReferralMsg({...values}, helpers); // FUNCTION TO SEND REFERRAL MESSAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
const [selectedTab, setSelectedTab] = useState("Send Referral");
|
const [selectedTab, setSelectedTab] = useState("Send Referral");
|
||||||
@@ -228,7 +237,7 @@ function ReferralDisplay() {
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
{error.message != "" && (
|
{error.message != "" && (
|
||||||
<p className="text-base text-red-500 py-2">{error.message}</p>
|
<p className={`text-base py-2 ${error.status ? 'text-emerald-500' : 'text-red-500'}`}>{error.message}</p>
|
||||||
)}
|
)}
|
||||||
<div className="referral-btn flex justify-end items-center py-4">
|
<div className="referral-btn flex justify-end items-center py-4">
|
||||||
{error.loading ? (
|
{error.loading ? (
|
||||||
@@ -237,6 +246,7 @@ function ReferralDisplay() {
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
disabled={error.loading || error.status}
|
||||||
>
|
>
|
||||||
Send Message
|
Send Message
|
||||||
</button>
|
</button>
|
||||||
@@ -251,9 +261,12 @@ function ReferralDisplay() {
|
|||||||
{selectedTab == 'Referral List' &&
|
{selectedTab == 'Referral List' &&
|
||||||
<>
|
<>
|
||||||
<div className="w-full p-4">
|
<div className="w-full p-4">
|
||||||
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<div className='mb-2 flex flex-wrap gap-4 items-center'>
|
||||||
Referral List
|
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||||
</h2>
|
Referral List
|
||||||
|
</h2>
|
||||||
|
<p className='text-slate-900 dark:text-white text-sm lg:text-base'>Uncompleted signup will be removed automatically after 7 days</p>
|
||||||
|
</div>
|
||||||
{referralList.loading ? (
|
{referralList.loading ? (
|
||||||
<LoadingSpinner size="22" color="sky-blue" />
|
<LoadingSpinner size="22" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState, useContext } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
||||||
import LoadingSpinner from "../components/Spinners/LoadingSpinner";
|
import LoadingSpinner from "../components/Spinners/LoadingSpinner";
|
||||||
@@ -15,16 +15,20 @@ import { familyBannersList } from "../store/FamilyBannerList";
|
|||||||
import { familyResources } from "../store/FamilyResources";
|
import { familyResources } from "../store/FamilyResources";
|
||||||
import {familyWalletRedeemOptList} from '../store/FamilyWalletRedeemOpt'
|
import {familyWalletRedeemOptList} from '../store/FamilyWalletRedeemOpt'
|
||||||
import { SocketValues } from "../components/Contexts/SocketIOContext";
|
import { SocketValues } from "../components/Contexts/SocketIOContext";
|
||||||
|
import DarkModeContext from '../components/Contexts/DarkModeContext'
|
||||||
|
|
||||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||||
|
|
||||||
let {joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
|
|
||||||
|
// const [nocache, setNoCache] = useState(false) // holds cache/nocache value
|
||||||
|
|
||||||
|
const {nocache, setNoCache} = useContext(DarkModeContext); // Destructures nocache and set nocache from context API
|
||||||
|
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
||||||
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
||||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
||||||
@@ -46,19 +50,12 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const checkInactivity = setInterval(() => {
|
const checkInactivity = setInterval(() => {
|
||||||
let { account_type } = loadProfileDetails;
|
|
||||||
if (account_type === "FAMILY") {
|
if (account_type === "FAMILY") {
|
||||||
if (
|
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY)) {
|
||||||
Date.now() - lastActivityTime >
|
|
||||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY
|
|
||||||
) {
|
|
||||||
expireSession();
|
expireSession();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES)) {
|
||||||
Date.now() - lastActivityTime >
|
|
||||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
|
|
||||||
) {
|
|
||||||
expireSession();
|
expireSession();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +65,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
return () => {
|
return () => {
|
||||||
clearInterval(checkInactivity);
|
clearInterval(checkInactivity);
|
||||||
};
|
};
|
||||||
}, [lastActivityTime, navigate]);
|
}, [lastActivityTime, navigate, isLogin.status]);
|
||||||
|
|
||||||
// Reset last activity time on user input
|
// Reset last activity time on user input
|
||||||
const resetTime = useCallback(() => {
|
const resetTime = useCallback(() => {
|
||||||
@@ -97,9 +94,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
setIsLogin({ loading: false, status: false });
|
setIsLogin({ loading: false, status: false });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoadProfileDetails(res.data);
|
|
||||||
dispatch(updateUserDetails({ ...res.data }));
|
dispatch(updateUserDetails({ ...res.data }));
|
||||||
setIsLogin({ loading: false, status: true });
|
setIsLogin({ loading: false, status: true });
|
||||||
|
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setIsLogin({ loading: false, status: false });
|
setIsLogin({ loading: false, status: false });
|
||||||
@@ -108,24 +105,26 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
loadProfile();
|
loadProfile();
|
||||||
}else{
|
}else{
|
||||||
setIsLogin({ loading: false, status: true });
|
setIsLogin({ loading: false, status: true });
|
||||||
|
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dispatch(commonHeadBanner({loading:true, data:{}}));
|
||||||
apiCall
|
apiCall
|
||||||
.getHeroJBanners()
|
.getHeroJBanners()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.data?.internal_return < 0) {
|
if (res?.data?.internal_return < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(commonHeadBanner(res.data));
|
dispatch(commonHeadBanner({loading:false, data:res.data}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// console.log("ERROR ", error);
|
dispatch(commonHeadBanner({loading:false, data:{}}));
|
||||||
});
|
});
|
||||||
}, [isLogin.status, homeBanners]);
|
}, [isLogin.status, homeBanners]);
|
||||||
|
|
||||||
@@ -140,8 +139,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
dispatch(updateNotifications({ loading: false, data: null }));
|
dispatch(updateNotifications({ loading: false, data: null }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoadProfileDetails(res.data);
|
|
||||||
|
|
||||||
const _raw = res.data?.result_list;
|
const _raw = res.data?.result_list;
|
||||||
|
|
||||||
//Sort the notifications in ascending order based on the API time
|
//Sort the notifications in ascending order based on the API time
|
||||||
@@ -192,7 +189,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getMyJobList = async () => {
|
const getMyJobList = async () => {
|
||||||
@@ -213,7 +210,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FULL USER WALLETS
|
//FUNCTION TO GET FULL USER WALLETS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getMyWalletList = async () => {
|
const getMyWalletList = async () => {
|
||||||
@@ -235,7 +232,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
// FUNCTION TO GET MARKET JOB LIST
|
// FUNCTION TO GET MARKET JOB LIST
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Getting market data
|
// Getting market data
|
||||||
@@ -254,7 +251,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
// if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// apiCall
|
// apiCall
|
||||||
@@ -274,13 +271,16 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY BANNERS
|
//FUNCTION TO GET FAMILY BANNERS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getFamilyBanners = async () => { // FUNCTION TO GET FAMILY BANNERS
|
const getFamilyBanners = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||||
// setFamilyBannersList({loading:true, result:[]});
|
// setFamilyBannersList({loading:true, result:[]});
|
||||||
|
dispatch(familyBannersList({loading:true}))
|
||||||
|
const noCache = (isLogin.status && nocache )? 1 : 0
|
||||||
|
const reqData = {nocache: noCache}
|
||||||
try {
|
try {
|
||||||
const res = await apiCall.getFamilyBannersList();
|
const res = await apiCall.getFamilyBannersList(reqData);
|
||||||
dispatch(familyBannersList({...res?.data, loading:false}))
|
dispatch(familyBannersList({...res?.data, loading:false}))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(familyBannersList({loading:false}))
|
dispatch(familyBannersList({loading:false}))
|
||||||
@@ -292,7 +292,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY RESOURCES
|
//FUNCTION TO GET FAMILY RESOURCES
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||||
@@ -310,7 +310,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY WALLET REDEEM OPTIONS
|
//FUNCTION TO GET FAMILY WALLET REDEEM OPTIONS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const familyWalletRedeemOptions = async () => { // FUNCTION TO GET FAMILY WALLET REDDEM OPTIONS
|
const familyWalletRedeemOptions = async () => { // FUNCTION TO GET FAMILY WALLET REDDEM OPTIONS
|
||||||
|
|||||||
@@ -618,8 +618,8 @@ class usersService {
|
|||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
offset: 1,
|
offset: 0,
|
||||||
limit: 100,
|
limit: 140,
|
||||||
action: apiConst.WRENCHBOARD_ACCOUNT_REFFERHX,
|
action: apiConst.WRENCHBOARD_ACCOUNT_REFFERHX,
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/refferhx", postData);
|
return this.postAuxEnd("/refferhx", postData);
|
||||||
@@ -1396,7 +1396,7 @@ class usersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// API FUNCTION TO FAMILY BANNERS
|
// API FUNCTION TO FAMILY BANNERS
|
||||||
getFamilyBannersList() {
|
getFamilyBannersList(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
@@ -1404,6 +1404,7 @@ class usersService {
|
|||||||
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
offset: 1,
|
offset: 1,
|
||||||
|
...reqData
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/familybanners", postData);
|
return this.postAuxEnd("/familybanners", postData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
commonHeadBanner: {}
|
commonHeadBanner: {loading:true, data:{}}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const commonHeadBannerSlice = createSlice({
|
export const commonHeadBannerSlice = createSlice({
|
||||||
|
|||||||
+1
-18
@@ -1,27 +1,10 @@
|
|||||||
import {useState, useEffect} from 'react'
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import Home from "../components/Home";
|
import Home from "../components/Home";
|
||||||
|
|
||||||
export default function HomePages() {
|
export default function HomePages() {
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
|
||||||
|
|
||||||
const [bannerOptions, setBannerOptions] = useState({})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
const bannerOptions = {
|
|
||||||
bannerList: commonHeadBanner?.result_list,
|
|
||||||
dashTypes: commonHeadBanner?.home_dash_type,
|
|
||||||
offersList: commonHeadBanner?.offers_list,
|
|
||||||
imageServer: commonHeadBanner?.session_image_server
|
|
||||||
};
|
|
||||||
setBannerOptions(bannerOptions)
|
|
||||||
},[commonHeadBanner])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Home {...bannerOptions} />
|
<Home />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,79 @@
|
|||||||
import React from "react";
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import usersService from '../services/UsersService'
|
||||||
|
|
||||||
import SignUp from "../components/AuthPages/SignUp/index2";
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
|
import LoadingSpinner from '../components/Spinners/LoadingSpinner'
|
||||||
|
import AuthLayout from '../components/AuthPages/AuthLayout2'
|
||||||
|
|
||||||
function SignupPageTwo() {
|
function SignupPageTwo() {
|
||||||
|
const api = new usersService()
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const refer_link = queryParams.get("refer_link")?.toUpperCase();
|
||||||
|
|
||||||
|
const [reload, setReload] = useState(false)
|
||||||
|
|
||||||
|
let [details, setDetails] = useState({loading:true, error:false, data:{}})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setDetails({loading:true, error:false, data:{}})
|
||||||
|
if(refer_link){
|
||||||
|
// const timer = setTimeout(()=>{
|
||||||
|
// setDetails({loading:false, data:{
|
||||||
|
// first_name: 'Emeka',
|
||||||
|
// last_name: 'John',
|
||||||
|
// email: 'example@example.com'
|
||||||
|
// }})
|
||||||
|
// },[1000])
|
||||||
|
api.verifyEmail(refer_link).then(res => {
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
console.log('RES', rres)
|
||||||
|
}).catch(err => {
|
||||||
|
setDetails({loading:false, error:true, data:{}})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
}
|
||||||
|
},[reload])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SignUp />
|
{details.loading ?
|
||||||
|
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
||||||
|
: details.error ?
|
||||||
|
<AuthLayout>
|
||||||
|
<ErrorComponent onClick={()=>setReload(prev => !prev)} />
|
||||||
|
</AuthLayout>
|
||||||
|
:
|
||||||
|
<SignUp details={details.data} />
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SignupPageTwo;
|
export default SignupPageTwo;
|
||||||
|
|
||||||
|
|
||||||
|
const ErrorComponent = ({ onClick }) => (
|
||||||
|
<div className="input-area">
|
||||||
|
<div className="my-5">
|
||||||
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
|
This error occurs because you have already verified this link or the
|
||||||
|
link has expired. Try login or reset password. If none worked, try to
|
||||||
|
create the account from the start.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="signin-area flex justify-center mb-3.5">
|
||||||
|
<button
|
||||||
|
onClick={onClick}
|
||||||
|
type="button"
|
||||||
|
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
|
>
|
||||||
|
<span>Try Again</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user