Compare commits
87 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 | |||
| c889c0b093 | |||
| 6b95b8d1ce | |||
| c60debfbba | |||
| cee984e574 | |||
| bf28e501a9 | |||
| 441b21ec35 | |||
| 5f8acf0d7d | |||
| aaf98caf19 | |||
| 3326a61a1f | |||
| 5d4033348c | |||
| 9fb7bb3ed9 | |||
| 4e9f95e59e | |||
| a35394c546 | |||
| 5e1c22674a | |||
| 1f58eec668 | |||
| a161453752 | |||
| 823fea91fb | |||
| ff88b5ddb2 | |||
| 55c99f1c33 | |||
| 334357bdc1 | |||
| b6908b84af | |||
| 4ef031a03f | |||
| f5eef3f679 | |||
| 339a0063ce | |||
| e1ffca88af | |||
| 96f3e3ed18 | |||
| 49b10cc57b | |||
| 83d9b80cb0 | |||
| 90a2c2fa5b | |||
| 503552bcd0 | |||
| b0b36c53d0 | |||
| 387d30b011 | |||
| be31d80013 | |||
| f306856ffd | |||
| 779e39e7c9 | |||
| d65522ee64 | |||
| f8f5fbc3af | |||
| ae494b3e48 | |||
| d2de4e8d56 | |||
| cdd6b1beb5 | |||
| 96cb474288 | |||
| 897864b330 | |||
| 6396ab33d0 | |||
| ac3157bf30 | |||
| 5055676077 | |||
| fd0fec0060 | |||
| 4aed14a545 | |||
| c2111c5122 | |||
| bc9793f997 | |||
| 11e356cda6 | |||
| dd4239312d | |||
| 70ada36c00 | |||
| e6e41de965 | |||
| 0fbbf38d6c | |||
| 040c79e2e5 | |||
| 78b973e3d4 | |||
| 48df81e697 | |||
| 6ef31e5dbe | |||
| 530dbc9c6c | |||
| 28832fdab0 | |||
| 70c205ffca | |||
| fad38331db | |||
| 9e15c51c31 | |||
| b2bffb3b83 | |||
| dd1a2953da |
@@ -1,4 +1,5 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
|
REACT_APP_NODE_ENV="development"
|
||||||
|
|
||||||
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
||||||
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
||||||
@@ -22,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
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
|
REACT_APP_NODE_ENV="development"
|
||||||
|
|
||||||
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
||||||
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
||||||
@@ -22,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
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
SKIP_PREFLIGHT_CHECK=true
|
SKIP_PREFLIGHT_CHECK=true
|
||||||
|
REACT_APP_NODE_ENV="production"
|
||||||
|
|
||||||
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
REACT_APP_FACEBOOK="https://www.facebook.com/profile.php?id=100066498622246"
|
||||||
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
REACT_APP_TWITTER="https://twitter.com/fluxtra"
|
||||||
@@ -22,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
|
||||||
|
|||||||
+5
-2
@@ -1,5 +1,8 @@
|
|||||||
# pull the base image
|
# pull the base image
|
||||||
FROM node:alpine
|
#FROM node:alpine
|
||||||
|
FROM node:20.11.0-alpine
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Build args
|
# Build args
|
||||||
ARG NODE_ENV
|
ARG NODE_ENV
|
||||||
@@ -26,7 +29,7 @@ COPY nginx.conf ./
|
|||||||
|
|
||||||
COPY run.sh ./
|
COPY run.sh ./
|
||||||
|
|
||||||
RUN npm install --legacy-peer-deps
|
# RUN npm install --legacy-peer-deps
|
||||||
|
|
||||||
# add app
|
# add app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|||||||
+3
-2
@@ -3,6 +3,7 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@fvilers/disable-react-devtools": "^1.3.0",
|
||||||
"@react-oauth/google": "^0.11.0",
|
"@react-oauth/google": "^0.11.0",
|
||||||
"@reduxjs/toolkit": "^1.8.2",
|
"@reduxjs/toolkit": "^1.8.2",
|
||||||
"@tailwindcss/line-clamp": "^0.3.1",
|
"@tailwindcss/line-clamp": "^0.3.1",
|
||||||
@@ -30,14 +31,14 @@
|
|||||||
"react-to-print": "^2.14.12",
|
"react-to-print": "^2.14.12",
|
||||||
"react-toastify": "^9.0.1",
|
"react-toastify": "^9.0.1",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"socket.io-client": "^4.4.1",
|
|
||||||
"slick-carousel": "^1.8.1",
|
"slick-carousel": "^1.8.1",
|
||||||
|
"socket.io-client": "^4.4.1",
|
||||||
"web-vitals": "^1.0.1",
|
"web-vitals": "^1.0.1",
|
||||||
"yup": "^1.1.1"
|
"yup": "^1.1.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start -e .env.development",
|
"start": "react-scripts start -e .env.development",
|
||||||
"build": "react-scripts build -e .env.production",
|
"build": "GENERATE_SOURCEMAP=false react-scripts build -e .env.production",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"short_name": "React App",
|
"short_name": "WrenchBoard App",
|
||||||
"name": "Create React App Sample",
|
"name": "WrenchBoard User Web",
|
||||||
"icons": [],
|
"icons": [],
|
||||||
"start_url": ".",
|
"start_url": ".",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ else
|
|||||||
echo "Production build"
|
echo "Production build"
|
||||||
npm install --legacy-peer-deps
|
npm install --legacy-peer-deps
|
||||||
npm run build
|
npm run build
|
||||||
|
# Testing sometimes
|
||||||
|
# npm run start
|
||||||
nginx -g 'daemon off;' -c /usr/src/app/nginx.conf
|
nginx -g 'daemon off;' -c /usr/src/app/nginx.conf
|
||||||
nginx -c /usr/src/app/nginx.conf
|
nginx -c /usr/src/app/nginx.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
+15
-5
@@ -1,23 +1,33 @@
|
|||||||
|
import {Suspense, lazy} from 'react'
|
||||||
import { Navigate, useLocation } from "react-router-dom";
|
import { Navigate, useLocation } from "react-router-dom";
|
||||||
import Routers from "./Routers";
|
// import Routers from "./Routers";
|
||||||
|
// import SocketIOContextProvider from "./components/Contexts/SocketIOContext";
|
||||||
import Toaster from "./components/Helpers/Toaster";
|
import Toaster from "./components/Helpers/Toaster";
|
||||||
import Default from "./components/Partials/Default";
|
import Default from "./components/Partials/Default";
|
||||||
import SocketIOContextProvider from "./components/Contexts/SocketIOContext";
|
|
||||||
|
|
||||||
|
import { disableReactDevTools } from '@fvilers/disable-react-devtools';
|
||||||
|
import LoadingSpinner from './components/Spinners/LoadingSpinner';
|
||||||
|
|
||||||
|
if (process.env.REACT_APP_NODE_ENV === 'production') {
|
||||||
|
disableReactDevTools();
|
||||||
|
}
|
||||||
|
const Routers = lazy(()=>import('./Routers'))
|
||||||
function App() {
|
function App() {
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
return (
|
return (
|
||||||
<Default>
|
<Default>
|
||||||
<SocketIOContextProvider>
|
{/* <SocketIOContextProvider> */}
|
||||||
<>
|
<>
|
||||||
{pathname.startsWith("/@") ? (
|
{pathname.startsWith("/@") ? (
|
||||||
<Navigate to="/app" replace={true} />
|
<Navigate to="/app" replace={true} />
|
||||||
) : (
|
) : (
|
||||||
<Routers />
|
<Suspense fallback={<LoadingSpinner size="32" color="sky-blue" height="h-screen" />}>
|
||||||
|
<Routers />
|
||||||
|
</Suspense>
|
||||||
)}
|
)}
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</>
|
</>
|
||||||
</SocketIOContextProvider>
|
{/* </SocketIOContextProvider> */}
|
||||||
</Default>
|
</Default>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+141
-158
@@ -1,84 +1,84 @@
|
|||||||
import { Route, Routes } from "react-router-dom";
|
import { Route, Routes } from "react-router-dom";
|
||||||
import FourZeroFour from "./components/FourZeroFour";
|
import { lazy } from "react";
|
||||||
import ScrollToTop from "./components/Helpers/ScrollToTop";
|
|
||||||
import StartJob from "./components/MyJobs/StartJob";
|
import LoginLandingPage from './views/LoginLandingPage'
|
||||||
import Notification from "./components/Notification";
|
|
||||||
import AuthRoute from "./middleware/AuthRoute";
|
|
||||||
import AppDownloadPage from "./views/AppDownloadPage";
|
|
||||||
import AppleRedirectPage from "./views/AppleRedirectPage";
|
|
||||||
import AuthProfilePage from "./views/AuthProfilePage";
|
|
||||||
import AuthRedirect from "./views/AuthRedirect";
|
|
||||||
import BlogPage from "./views/BlogPage";
|
|
||||||
import CalendarPage from "./views/CalendarPage";
|
|
||||||
import CollectionItemPage from "./views/CollectionItemPage";
|
|
||||||
import FacebookRedirect from "./views/FacebookRedirect";
|
|
||||||
import FamilyAccPage from "./views/FamilyAccPage";
|
|
||||||
import FamilyManagePage from "./views/FamilyManagePage";
|
|
||||||
import FamilyMarketPage from "./views/FamilyMarketPage";
|
|
||||||
import FamilySettingsPage from "./views/FamilySettingsPage";
|
|
||||||
import ForgotPasswordPages from "./views/ForgotPasswordPages";
|
|
||||||
import ForgotPasswordPagesTwo from "./views/ForgotPasswordPagesTwo";
|
|
||||||
import HistoryPage from "./views/HistoryPage";
|
|
||||||
import HomePages from "./views/HomePages";
|
|
||||||
import JobGroupsPage from "./views/JobGroupsPage";
|
|
||||||
import LndPage from "./views/LndPage";
|
|
||||||
import LoginPage from "./views/LoginPage";
|
import LoginPage from "./views/LoginPage";
|
||||||
import LoginPageTwo from "./views/LoginPageTwo";
|
import SocketConnection from "./middleware/SocketConnection";
|
||||||
import ManageActiveJobs from "./views/ManageActiveJobs";
|
|
||||||
import ManageInterestOfferPage from "./views/ManageInterestOfferPage";
|
const HomePages = lazy(() => import("./views/HomePages"));
|
||||||
import MarketPlacePage from "./views/MarketPlacePage";
|
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
||||||
import MyActiveJobsPage from "./views/MyActiveJobsPage";
|
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
||||||
import MyCouponPage from "./views/MyCouponPage";
|
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
||||||
import MyJobsPage from "./views/MyJobsPage";
|
const Notification = lazy(() => import("./components/Notification"));
|
||||||
import MyOffersPage from "./views/MyOffersPage";
|
const AuthRoute = lazy(() => import("./middleware/AuthRoute"));
|
||||||
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
|
const AppDownloadPage = lazy(() => import("./views/AppDownloadPage"));
|
||||||
import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
|
const AppleRedirectPage = lazy(() => import("./views/AppleRedirectPage"));
|
||||||
import MyTaskPage from "./views/MyTaskPage";
|
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
||||||
import MyWaitingJobsPage from "./views/MyWaitingJobsPage";
|
const AuthRedirect = lazy(() => import("./views/AuthRedirect"));
|
||||||
import MyWalletPage from "./views/MyWalletPage";
|
const BlogPage = lazy(() => import("./views/BlogPage"));
|
||||||
import OffersInterestPage from "./views/OffersInterestPage";
|
const FacebookRedirect = lazy(() => import("./views/FacebookRedirect"));
|
||||||
import ReferralPage from "./views/ReferralPage";
|
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
||||||
import RemindersPage from "./views/RemindersPage";
|
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
||||||
import ResourcePage from "./views/ResourcePage";
|
|
||||||
import SavedPage from "./views/SavedPage";
|
const ForgotPasswordPages = lazy(()=> import("./views/ForgotPasswordPages"));
|
||||||
import SellPage from "./views/SellPage";
|
const ForgotPasswordPagesTwo = lazy(()=> import("./views/ForgotPasswordPagesTwo"));
|
||||||
import SettingsPage from "./views/SettingsPage";
|
const HistoryPage = lazy(()=> import("./views/HistoryPage"));
|
||||||
import SignupPage from "./views/SignupPage";
|
const JobGroupsPage = lazy(()=> import("./views/JobGroupsPage"));
|
||||||
import SignupPageTwo from "./views/SignupPageTwo";
|
const LndPage = lazy(()=> import("./views/LndPage"));
|
||||||
import TrackingPage from "./views/TrackingPage";
|
const LoginPageTwo = lazy(()=> import("./views/LoginPageTwo"));
|
||||||
import UpdatePasswordPages from "./views/UpdatePasswordPages";
|
const ManageActiveJobs = lazy(()=> import("./views/ManageActiveJobs"));
|
||||||
import UpdatePasswordPagesTwo from "./views/UpdatePasswordPagesTwo";
|
const ManageInterestOfferPage = lazy(()=> import("./views/ManageInterestOfferPage"));
|
||||||
import UploadProductPage from "./views/UploadProductPage";
|
const MarketPlacePage = lazy(()=> import("./views/MarketPlacePage"));
|
||||||
import UserProfilePage from "./views/UserProfilePage";
|
const MyActiveJobsPage = lazy(()=> import("./views/MyActiveJobsPage"));
|
||||||
import VerifyLinkPages from "./views/VerifyLinkPages";
|
const MyCouponPage = lazy(()=> import("./views/MyCouponPage"));
|
||||||
import VerifyLinkPagesTwo from "./views/VerifyLinkPagesTwo";
|
const MyJobsPage = lazy(()=> import("./views/MyJobsPage"));
|
||||||
import VerifyPasswordPages from "./views/VerifyPasswordPages";
|
const MyOffersPage = lazy(()=> import("./views/MyOffersPage"));
|
||||||
import VerifyPasswordPagesTwo from "./views/VerifyPasswordPagesTwo";
|
const MyPastDueJobsPage = lazy(()=> import("./views/MyPastDueJobsPage"));
|
||||||
import VerifyYouPages from "./views/VerifyYouPages";
|
const MyReviewDueJobsPage = lazy(()=> import("./views/MyReviewDueJobsPage"));
|
||||||
import VerifyYouPagesTwo from "./views/VerifyYouPagesTwo";
|
const MyTaskPage = lazy(()=> import("./views/MyTaskPage"));
|
||||||
import YourPages from "./views/YourPage_";
|
const MyWaitingJobsPage = lazy(()=> import("./views/MyWaitingJobsPage"));
|
||||||
import ParentWaitingPage from "./views/ParentWaitingPage";
|
const MyWalletPage = lazy(()=> import("./views/MyWalletPage"));
|
||||||
import FamilyPendingOfferPage from "./views/FamilyPendingOfferPage";
|
const OffersInterestPage = lazy(()=> import("./views/OffersInterestPage"));
|
||||||
import FamBlogPage from "./views/FamBlogPage"
|
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
||||||
import FamAIQuestionPage from "./views/FamAIQuestionPage"
|
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
||||||
import FamMyFilesPage from "./views/FamMyFilesPage"
|
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
||||||
import FamWorkInProgressPage from "./views/FamWorkInProgressPage";
|
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
||||||
import MyPastDueTasksPage from "./views/MyPastDueTasksPage";
|
const SignupPage = lazy(()=> import("./views/SignupPage"));
|
||||||
import FamilyWalletPage from "./views/FamilyWalletPage";
|
const SignupPageTwo = lazy(()=> import("./views/SignupPageTwo"));
|
||||||
import FamilyActivitiesPage from "./views/FamilyActivitiesPage";
|
const TrackingPage = lazy(()=> import("./views/TrackingPage"));
|
||||||
import FamGamesPage from "./views/FamGamesPage";
|
const UpdatePasswordPages = lazy(()=> import("./views/UpdatePasswordPages"));
|
||||||
import FamilyRoutesPage from "./views/FamilyRoutesPage";
|
const UpdatePasswordPagesTwo = lazy(()=> import("./views/UpdatePasswordPagesTwo"));
|
||||||
import PromoPage from "./views/PromoPage";
|
const UploadProductPage = lazy(()=> import("./views/UploadProductPage"));
|
||||||
import LearnMorePage from "./views/LearnMorePage";
|
const UserProfilePage = lazy(()=> import("./views/UserProfilePage"));
|
||||||
|
const VerifyLinkPages = lazy(()=> import("./views/VerifyLinkPages"));
|
||||||
|
const VerifyLinkPagesTwo = lazy(()=> import("./views/VerifyLinkPagesTwo"));
|
||||||
|
const VerifyPasswordPages = lazy(()=> import("./views/VerifyPasswordPages"));
|
||||||
|
const VerifyPasswordPagesTwo = lazy(()=> import("./views/VerifyPasswordPagesTwo"));
|
||||||
|
const VerifyYouPages = lazy(()=> import("./views/VerifyYouPages"));
|
||||||
|
const VerifyYouPagesTwo = lazy(()=> import("./views/VerifyYouPagesTwo"));
|
||||||
|
const YourPages = lazy(()=> import("./views/YourPage_"));
|
||||||
|
const ParentWaitingPage = lazy(()=> import("./views/ParentWaitingPage"));
|
||||||
|
const FamilyPendingOfferPage = lazy(()=> import("./views/FamilyPendingOfferPage"));
|
||||||
|
const FamBlogPage = lazy(()=> import("./views/FamBlogPage"));
|
||||||
|
const FamAIQuestionPage = lazy(()=> import("./views/FamAIQuestionPage"));
|
||||||
|
const FamMyFilesPage = lazy(()=> import("./views/FamMyFilesPage"));
|
||||||
|
const FamWorkInProgressPage = lazy(()=> import("./views/FamWorkInProgressPage"));
|
||||||
|
const MyPastDueTasksPage = lazy(()=> import("./views/MyPastDueTasksPage"));
|
||||||
|
const FamilyWalletPage = lazy(()=> import("./views/FamilyWalletPage"));
|
||||||
|
const LearnMorePage = lazy(()=> import("./views/LearnMorePage"));
|
||||||
|
const FamGamesPage = lazy(()=> import("./views/FamGamesPage"));
|
||||||
|
const FamilyRoutesPage = lazy(()=> import("./views/FamilyRoutesPage"));
|
||||||
|
const PromoPage = lazy(()=> import("./views/PromoPage"));
|
||||||
|
|
||||||
export default function Routers() {
|
export default function Routers() {
|
||||||
return (
|
return (
|
||||||
<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={<LoginPageTwo />} />
|
<Route exact path="/login" element={<LoginLandingPage />} />
|
||||||
|
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
||||||
<Route exact path="/signup" element={<SignupPageTwo />} />
|
<Route exact path="/signup" element={<SignupPageTwo />} />
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
@@ -94,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 />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
@@ -125,93 +125,76 @@ export default function Routers() {
|
|||||||
<Route exact path="/app" element={<AppDownloadPage />} />
|
<Route exact path="/app" element={<AppDownloadPage />} />
|
||||||
|
|
||||||
{/* private route */}
|
{/* private route */}
|
||||||
<Route element={<AuthRoute />}>
|
<Route element={<SocketConnection />}>
|
||||||
<Route exact path="/" element={<HomePages />} />
|
<Route element={<AuthRoute />}>
|
||||||
{/* <Route exact path="/active-bids" element={<AcitveBidsPage />} />
|
<Route exact path="/" element={<HomePages />} />
|
||||||
<Route exact path="/notification" element={<Notification />} />
|
<Route exact path="/reminders" element={<RemindersPage />} />
|
||||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
<Route exact path="/tracking" element={<TrackingPage />} />
|
||||||
<Route exact path="/shop-details" element={<ShopDetailsPage />} />
|
<Route exact path="/resources" element={<ResourcePage />} />
|
||||||
<Route exact path="/my-collection" element={<MyCollection />} />*/}
|
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
||||||
<Route exact path="/reminders" element={<RemindersPage />} />
|
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
||||||
<Route exact path="/tracking" element={<TrackingPage />} />
|
<Route exact path="/my-coupon" element={<MyCouponPage />} />
|
||||||
<Route exact path="/calendar" element={<CalendarPage />} />
|
<Route exact path="/notification" element={<Notification />} />
|
||||||
<Route exact path="/resources" element={<ResourcePage />} />
|
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
||||||
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
<Route exact path="/market" element={<MarketPlacePage />} />
|
||||||
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
<Route exact path="/familymarket" element={<FamilyMarketPage />} />
|
||||||
<Route exact path="/my-coupon" element={<MyCouponPage />} />
|
<Route exact path="/suggested" element={<ParentWaitingPage />} />
|
||||||
<Route exact path="/notification" element={<Notification />} />
|
<Route exact path="/parentwaiting" element={<ParentWaitingPage />} />
|
||||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
<Route exact path="/pending" element={<FamilyPendingOfferPage />} />
|
||||||
<Route exact path="/market" element={<MarketPlacePage />} />
|
<Route exact path="/fam-blog" element={<FamBlogPage />} />
|
||||||
<Route exact path="/familymarket" element={<FamilyMarketPage />} />
|
<Route exact path="/ai-question" element={<FamAIQuestionPage />} />
|
||||||
<Route exact path="/suggested" element={<ParentWaitingPage />} />
|
<Route exact path="/myfiles" element={<FamMyFilesPage />} />
|
||||||
<Route exact path="/pending" element={<FamilyPendingOfferPage />} />
|
<Route exact path="/ai-lab" element={<FamAIQuestionPage />} />
|
||||||
<Route exact path="/fam-blog" element={<FamBlogPage />} />
|
<Route exact path="/fam-games" element={<FamGamesPage />} />
|
||||||
<Route exact path="/ai-question" element={<FamAIQuestionPage />} />
|
<Route exact path="/work-in-progress" element={<FamWorkInProgressPage />} />
|
||||||
<Route exact path="/myfiles" element={<FamMyFilesPage />} />
|
|
||||||
<Route exact path="/ai-lab" element={<FamAIQuestionPage />} />
|
|
||||||
<Route exact path="/fam-games" element={<FamGamesPage />} />
|
|
||||||
<Route exact path="/work-in-progress" element={<FamWorkInProgressPage />} />
|
|
||||||
|
|
||||||
<Route exact path="/pastdue" element={<MyPastDueTasksPage />} />
|
<Route exact path="/pastdue" element={<MyPastDueTasksPage />} />
|
||||||
<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
|
path="/my-pastdue-jobs"
|
||||||
path="/my-pastdue-jobs"
|
element={<MyPastDueJobsPage />}
|
||||||
element={<MyPastDueJobsPage />}
|
/>
|
||||||
/>
|
<Route exact path="/my-offers" element={<MyOffersPage />} />
|
||||||
<Route exact path="/my-offers" element={<MyOffersPage />} />
|
<Route exact path="/pend-interest" element={<MyWaitingJobsPage />} />
|
||||||
<Route exact path="/pend-interest" element={<MyWaitingJobsPage />} />
|
<Route
|
||||||
<Route
|
exact
|
||||||
exact
|
path="/my-review-jobs"
|
||||||
path="/my-review-jobs"
|
element={<MyReviewDueJobsPage />}
|
||||||
element={<MyReviewDueJobsPage />}
|
/>
|
||||||
/>
|
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
||||||
|
|
||||||
{/* <Route exact path='/acc-family' element={<FamilyAccPage />} />
|
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||||
<Route exact path="/acc-family/activities" element={<FamilyActivitiesPage />} />
|
<Route exact path="/start-job" element={<StartJob />} />
|
||||||
<Route exact path="/acc-family/familysettings" element={<FamilySettingsPage />} /> */}
|
<Route exact path="/yourpage" element={<YourPages />} />
|
||||||
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
<Route
|
||||||
|
exact
|
||||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
path="/manage-active-job"
|
||||||
<Route exact path="/start-job" element={<StartJob />} />
|
element={<ManageActiveJobs />}
|
||||||
<Route exact path="/yourpage" element={<YourPages />} />
|
/>
|
||||||
<Route
|
<Route exact path="/blog-page" element={<BlogPage />} />
|
||||||
exact
|
<Route
|
||||||
path="/manage-active-job"
|
exact
|
||||||
element={<ManageActiveJobs />}
|
path="/offer-interest"
|
||||||
/>
|
element={<OffersInterestPage />}
|
||||||
<Route exact path="/blog-page" element={<BlogPage />} />
|
/>
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path="/offer-interest"
|
path="/manage-offer"
|
||||||
element={<OffersInterestPage />}
|
element={<ManageInterestOfferPage />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route exact path="/history" element={<HistoryPage />} />
|
||||||
exact
|
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
||||||
path="/manage-offer"
|
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
||||||
element={<ManageInterestOfferPage />}
|
<Route exact path="/profile" element={<AuthProfilePage />} />
|
||||||
/>
|
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
||||||
|
<Route exact path="/settings" element={<SettingsPage />} />
|
||||||
<Route
|
<Route exact path="/referral" element={<ReferralPage />} />
|
||||||
exact
|
<Route exact path="/job-groups" element={<JobGroupsPage />} />
|
||||||
path="/my-collection/collection-item"
|
</Route>
|
||||||
element={<CollectionItemPage />}
|
|
||||||
/>
|
|
||||||
<Route exact path="/sell" element={<SellPage />} />
|
|
||||||
<Route exact path="/saved" element={<SavedPage />} />
|
|
||||||
<Route exact path="/history" element={<HistoryPage />} />
|
|
||||||
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
|
||||||
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
|
|
||||||
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
|
||||||
<Route exact path="/profile" element={<AuthProfilePage />} />
|
|
||||||
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
|
||||||
<Route exact path="/settings" element={<SettingsPage />} />
|
|
||||||
<Route exact path="/referral" element={<ReferralPage />} />
|
|
||||||
<Route exact path="/job-groups" element={<JobGroupsPage />} />
|
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="*" element={<FourZeroFour />} />
|
<Route path="*" element={<FourZeroFour />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 503 KiB |
@@ -3,7 +3,7 @@ import {
|
|||||||
useDispatch,
|
useDispatch,
|
||||||
useSelector,
|
useSelector,
|
||||||
usersService,
|
usersService,
|
||||||
initialValues as IV,
|
// initialValues as IV,
|
||||||
initialReqState,
|
initialReqState,
|
||||||
useState,
|
useState,
|
||||||
tableReload,
|
tableReload,
|
||||||
@@ -75,7 +75,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
// For form initial values
|
// For form initial values
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
// initial values for formik
|
// initial values for formik
|
||||||
country: walletDetails.data.length == 1 ? walletDetails.data[0].country : '',
|
country: walletDetails.data.length === 1 ? walletDetails.data[0].country : '',
|
||||||
price: "",
|
price: "",
|
||||||
title: "",
|
title: "",
|
||||||
description: "",
|
description: "",
|
||||||
@@ -117,7 +117,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
onBlur={props.handleBlur}
|
onBlur={props.handleBlur}
|
||||||
disabled={walletDetails.data.length == 1}
|
disabled={walletDetails.data.length === 1}
|
||||||
>
|
>
|
||||||
{walletDetails?.loading ? (
|
{walletDetails?.loading ? (
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
@@ -138,7 +138,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
) : walletDetails.data.length == 1 ?
|
) : walletDetails.data.length === 1 ?
|
||||||
<>
|
<>
|
||||||
{walletDetails.data?.map((item, index) => (
|
{walletDetails.data?.map((item, index) => (
|
||||||
<option
|
<option
|
||||||
@@ -367,7 +367,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||||
<div className="content-footer w-full">
|
<div className="content-footer w-full">
|
||||||
{/* error or success display */}
|
{/* error or success display */}
|
||||||
{requestStatus.message != "" &&
|
{requestStatus.message !== "" &&
|
||||||
(!requestStatus.status ? (
|
(!requestStatus.status ? (
|
||||||
<div
|
<div
|
||||||
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
className={`relative p-4 my-4 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React, { useContext } from "react";
|
import React, { useContext } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { localImgLoad } from "../../lib";
|
import { localImgLoad } from "../../lib";
|
||||||
|
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");
|
||||||
|
|
||||||
@@ -13,65 +14,74 @@ export default function LoginLayout({ slogan, children }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`min-h-screen overflow-y-auto bg-cover bg-center flex flex-col justify-between items-center`}
|
className={`relative min-h-screen overflow-y-auto bg-cover bg-center flex flex-col items-center`}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${countryMode == "NG" ? bgImgNig : bgImgCom})`,
|
backgroundImage: `url(${countryMode === "NG" ? bgImgNig : bgImgCom})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div className="my-5">
|
||||||
<div className={`w-full grid grid-cols-1 xl:grid-cols-2`}>
|
<Link to="#">
|
||||||
|
<img
|
||||||
|
src={WrenchBoard}
|
||||||
|
alt="wrenchboard"
|
||||||
|
className="h-10 mx-auto"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
<div className={`h-full w-full mb-5 grid grid-cols-1 place-content-center`}>
|
||||||
{/* <div
|
{/* <div
|
||||||
className={`auth-bg hidden xl:block bg-blue-50 relative bg-cover bg-no-repeat border-0 after:content-[''] after:absolute after:inset-0`}
|
className={`auth-bg hidden xl:block bg-blue-50 relative bg-cover bg-no-repeat border-0 after:content-[''] after:absolute after:inset-0`}
|
||||||
style={{backgroundImage: `url(${bgImg})`}}
|
style={{backgroundImage: `url(${bgImg})`}}
|
||||||
>
|
>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="p-5 sm:p-7 flex place-content-center xl:col-start-2">
|
<div className="p-5 sm:p-7 flex place-content-center">
|
||||||
<div className="py-5 w-full sm:w-11/12 max-w-[550px] shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
|
<div className="pt-5 pb-5 w-full sm:w-11/12 max-w-[550px] shadow-md bg-slate-50 dark:bg-dark-white rounded-[0.475rem]">
|
||||||
<div className="w-full flex justify-center items-center">
|
<div className="w-full flex justify-center items-center">
|
||||||
{children && children}
|
{children && children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className='absolute left-0 right-0 bottom-0'>
|
||||||
<div className='w-full shadow-md bg-slate-50 dark:bg-dark-white'>
|
<div className='w-full shadow-md bg-slate-50 dark:bg-dark-white'>
|
||||||
<div className="w-full flex flex-col md:flex-row justify-center items-center px-10 py-2">
|
<div className="w-full flex flex-col md:flex-row justify-center items-center px-10 py-2">
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<a
|
<a
|
||||||
href="https://www.wrenchboard.com/about-us"
|
href="https://www.wrenchboard.com/about-us"
|
||||||
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
About
|
About
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://www.wrenchboard.com/service"
|
href="https://www.wrenchboard.com/service"
|
||||||
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
Services
|
Services
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://www.wrenchboard.com/contact"
|
href="https://www.wrenchboard.com/contact"
|
||||||
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
Contact Us
|
Contact Us
|
||||||
</a>
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="text-black text-[15px] px-2 font-medium flex items-center gap-1">
|
||||||
|
<span className="dark:text-white">
|
||||||
|
© {new Date().getFullYear()} -
|
||||||
|
</span>
|
||||||
|
<Link to="/" className="text-[#009ef7] ml-1">
|
||||||
|
WrenchBoard
|
||||||
|
</Link>{" "}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-black text-[15px] px-2 font-medium flex items-center gap-1">
|
|
||||||
<span className="dark:text-white">
|
|
||||||
© {new Date().getFullYear()} -
|
|
||||||
</span>
|
|
||||||
<Link to="/" className="text-[#009ef7] ml-1">
|
|
||||||
WrenchBoard
|
|
||||||
</Link>{" "}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,63 +1,63 @@
|
|||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import authProfilePic from "../../../assets/images/auth-profile-picture.png";
|
import authProfilePic from "../../../assets/images/auth-profile-picture.png";
|
||||||
import profileBanner from "../../../assets/images/profile-cover.png";
|
import profileBanner from "../../../assets/images/profile-cover.png";
|
||||||
import collections from "../../../data/collectionplan_data.json";
|
|
||||||
import marketPlace from "../../../data/marketplace_data.json";
|
|
||||||
import products from "../../../data/product_data.json";
|
|
||||||
import Layout from "../../Partials/Layout";
|
import Layout from "../../Partials/Layout";
|
||||||
import ActivitiesTab from "./ActivitiesTab";
|
import ActivitiesTab from "./ActivitiesTab";
|
||||||
import CollectionTab from "./CollectionTab";
|
// import collections from "../../../data/collectionplan_data.json";
|
||||||
import CreatedTab from "./CreatedTab";
|
// import marketPlace from "../../../data/marketplace_data.json";
|
||||||
import HiddenProductsTab from "./HiddenProductsTab";
|
// import products from "../../../data/product_data.json";
|
||||||
import OnSaleTab from "./OnSaleTab";
|
// import CollectionTab from "./CollectionTab";
|
||||||
import OwnTab from "./OwnTab";
|
// import CreatedTab from "./CreatedTab";
|
||||||
|
// import HiddenProductsTab from "./HiddenProductsTab";
|
||||||
|
// import OnSaleTab from "./OnSaleTab";
|
||||||
|
// import OwnTab from "./OwnTab";
|
||||||
|
|
||||||
export default function AuthProfile() {
|
export default function AuthProfile() {
|
||||||
const onSaleProducts = marketPlace.data;
|
// const onSaleProducts = marketPlace.data;
|
||||||
const CreatedSell = marketPlace.data;
|
// const CreatedSell = marketPlace.data;
|
||||||
const CreatedBits = products.datas;
|
// const CreatedBits = products.datas;
|
||||||
// const mainProducts = products.datas;
|
// const mainProducts = products.datas;
|
||||||
const ownProducts = products.datas;
|
// const ownProducts = products.datas;
|
||||||
const collectionProducts = collections.data;
|
// const collectionProducts = collections.data;
|
||||||
|
|
||||||
const tabs = [
|
// const tabs = [
|
||||||
{
|
// {
|
||||||
id: 1,
|
// id: 1,
|
||||||
name: "onsale",
|
// name: "onsale",
|
||||||
content: "On Sale",
|
// content: "On Sale",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 2,
|
// id: 2,
|
||||||
name: "owned",
|
// name: "owned",
|
||||||
content: "Owned",
|
// content: "Owned",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 3,
|
// id: 3,
|
||||||
name: "created",
|
// name: "created",
|
||||||
content: "Created",
|
// content: "Created",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 4,
|
// id: 4,
|
||||||
name: "hidden",
|
// name: "hidden",
|
||||||
content: "Hidden",
|
// content: "Hidden",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 5,
|
// id: 5,
|
||||||
name: "collection",
|
// name: "collection",
|
||||||
content: "Collection",
|
// content: "Collection",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 6,
|
// id: 6,
|
||||||
name: "activity",
|
// name: "activity",
|
||||||
content: "Activity",
|
// content: "Activity",
|
||||||
},
|
// },
|
||||||
];
|
// ];
|
||||||
|
|
||||||
const [tab, setTab] = useState(tabs[0].name);
|
// const [tab, setTab] = useState(tabs[0].name);
|
||||||
const tabHandler = (value) => {
|
// const tabHandler = (value) => {
|
||||||
setTab(value);
|
// setTab(value);
|
||||||
};
|
// };
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import React, { 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 usersService from '../../../services/UsersService';
|
||||||
import {updateUserDetails} from "../../../store/UserDetails";
|
// import {updateUserDetails} from "../../../store/UserDetails";
|
||||||
import { useDispatch } from "react-redux";
|
// import { useDispatch } from "react-redux";
|
||||||
import AuthLayout from "../AuthLayout";
|
import AuthLayout from "../AuthLayout";
|
||||||
|
|
||||||
function AppleRedirect() {
|
function AppleRedirect() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const userApi = new usersService();
|
// const userApi = new usersService();
|
||||||
const dispatch = useDispatch()
|
// 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");
|
||||||
@@ -36,11 +36,11 @@ function AppleRedirect() {
|
|||||||
redirect_uri=https%3A//oauth2.example.com/code&
|
redirect_uri=https%3A//oauth2.example.com/code&
|
||||||
grant_type=authorization_code
|
grant_type=authorization_code
|
||||||
*/
|
*/
|
||||||
var reqData = {
|
// var reqData = {
|
||||||
auth_type: "APPLE",
|
// auth_type: "APPLE",
|
||||||
code: codeResponse,
|
// code: codeResponse,
|
||||||
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
// redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||||
};
|
// };
|
||||||
// userApi
|
// userApi
|
||||||
// .authStart(reqData)
|
// .authStart(reqData)
|
||||||
// .then((res) => {
|
// .then((res) => {
|
||||||
@@ -58,7 +58,7 @@ function AppleRedirect() {
|
|||||||
// navigate('/login', {state: {error: true}})
|
// navigate('/login', {state: {error: true}})
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
// });
|
// });
|
||||||
},[])
|
},[codeResponse, navigate])
|
||||||
return (
|
return (
|
||||||
<AuthLayout>
|
<AuthLayout>
|
||||||
<div className='min-h-[70vh]'>Redirecting ... </div>
|
<div className='min-h-[70vh]'>Redirecting ... </div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useMemo, useEffect } from 'react';
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import usersService from '../../../services/UsersService';
|
import usersService from '../../../services/UsersService';
|
||||||
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout";
|
|||||||
function FbookRedirect() {
|
function FbookRedirect() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const userApi = new usersService();
|
const userApi = useMemo(()=> new usersService(),[]);
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
@@ -52,7 +52,7 @@ function FbookRedirect() {
|
|||||||
userApi
|
userApi
|
||||||
.authStart(reqData)
|
.authStart(reqData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status == 200 && res.data.internal_return >= 0 && res.data.member_id && res.data.uid && res.data.session) {
|
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("member_id", `${res.data.member_id}`);
|
||||||
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}`);
|
||||||
@@ -66,7 +66,7 @@ function FbookRedirect() {
|
|||||||
navigate('/login', {state: {error: true}})
|
navigate('/login', {state: {error: true}})
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},[])
|
},[codeResponse, userApi, dispatch, navigate])
|
||||||
return (
|
return (
|
||||||
<AuthLayout>
|
<AuthLayout>
|
||||||
<div className='min-h-[70vh]'>Redirecting ... </div>
|
<div className='min-h-[70vh]'>Redirecting ... </div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect, useMemo } from "react";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
@@ -8,7 +8,7 @@ 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 userApi = useMemo(()=> new usersService(),[]);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
@@ -40,7 +40,7 @@ function Redirect() {
|
|||||||
.authStart(reqData)
|
.authStart(reqData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (
|
if (
|
||||||
res.status == 200 &&
|
res.status === 200 &&
|
||||||
res.data.internal_return >= 0 &&
|
res.data.internal_return >= 0 &&
|
||||||
res.data.member_id &&
|
res.data.member_id &&
|
||||||
res.data.uid &&
|
res.data.uid &&
|
||||||
@@ -59,7 +59,7 @@ function Redirect() {
|
|||||||
navigate("/login", { state: { error: true } });
|
navigate("/login", { state: { error: true } });
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}, []);
|
}, [codeResponse, userApi, dispatch, navigate]);
|
||||||
return (
|
return (
|
||||||
<AuthLayout>
|
<AuthLayout>
|
||||||
<div className="min-h-[70vh]">Redirecting ... </div>
|
<div className="min-h-[70vh]">Redirecting ... </div>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resetHandler = async () => {
|
const resetHandler = async () => {
|
||||||
if (email == "") {
|
if (email === "") {
|
||||||
setMsgError("An email is required");
|
setMsgError("An email is required");
|
||||||
return setTimeout(() => {
|
return setTimeout(() => {
|
||||||
setMsgError(null);
|
setMsgError(null);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
// import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout2";
|
import AuthLayout from "../AuthLayout2";
|
||||||
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resetHandler = async () => {
|
const resetHandler = async () => {
|
||||||
if (email == "") {
|
if (email === "") {
|
||||||
setMsgError("An email is required");
|
setMsgError("An email is required");
|
||||||
return setTimeout(() => {
|
return setTimeout(() => {
|
||||||
setMsgError(null);
|
setMsgError(null);
|
||||||
@@ -89,15 +89,6 @@ export default function ForgotPassword() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
|
||||||
<Link to="#">
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-10/12">
|
<div className="w-10/12">
|
||||||
{msgSuccess == null ?
|
{msgSuccess == null ?
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||||
|
import KidIcon from '../../../assets/images/auth/children.png'
|
||||||
|
import ParentIcon from '../../../assets/images/auth/adult.png'
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
|
import AuthLayout from "../AuthLayout2";
|
||||||
|
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
// import { updateUserDetails } from "../../../store/UserDetails";
|
||||||
|
|
||||||
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
|
|
||||||
|
export default function LoginLanding() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
// const sessionExpired = queryParams.get("sessionExpired");
|
||||||
|
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const userApi = new usersService();
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
|
<div className="w-full">
|
||||||
|
{/* <div className="mb-5">
|
||||||
|
<Link to="#">
|
||||||
|
<img
|
||||||
|
src={WrenchBoard}
|
||||||
|
alt="wrenchboard"
|
||||||
|
className="h-10 mx-auto"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</div> */}
|
||||||
|
{/* <div className="content-wrapper login shadow-md w-10/12 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="flex place-content-center">
|
||||||
|
<div className="w-10/12">
|
||||||
|
<div className='grid grid-cols-1 sm:grid-cols-5 gap-3'>
|
||||||
|
{/* APP DOWNLOAD STORE */}
|
||||||
|
<div className="col-span-1 order-2 sm:col-span-2 sm:order-1 w-full">
|
||||||
|
<div className="relative w-full h-full flex sm:flex-col justify-center gap-4">
|
||||||
|
<div className="w-28 sm:w-36">
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
href={process.env.REACT_APP_APPLE_APP}
|
||||||
|
>
|
||||||
|
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div className="w-28 sm:w-36">
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
href={process.env.REACT_APP_ANDROID_APP}
|
||||||
|
>
|
||||||
|
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div className='hidden sm:block absolute top-0 bottom-0 right-0 w-1 rounded-full bg-[linear-gradient(180deg,_#94a3b8,_#0f172a,_#94a3b8)]'></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-span-1 order-1 sm:col-span-3 sm:order-2 title-area flex flex-col gap-5 justify-center items-center relative text-center mb-5">
|
||||||
|
<h1 className="text-gray-400 font-medium text-[16.25px] leading-[24.375px]">
|
||||||
|
<span className='font-semibold text-[#4687ba] hover:text-[#009ef7] transition'>Log in</span> as a:
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<div className='w-full flex flex-col gap-4'>
|
||||||
|
<button name='full' onClick={()=>navigate('/login/parent', {state:{loginType:'full'}})} className='w-full mx-auto flex justify-between items-center p-4 md:p-8 rounded-lg bg-[#d5ebf8] text-[#009ef7] cursor-pointer'>
|
||||||
|
<div className='flex items-center gap-4'>
|
||||||
|
<img className='w-12 h-auto' src={ParentIcon} alt='login key' />
|
||||||
|
<p className='text-lg font-semibold'>Adult or Parent</p>
|
||||||
|
</div>
|
||||||
|
{/* <span>></span> */}
|
||||||
|
<i className="fa-solid fa-caret-right"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button name='family' onClick={()=>navigate('/login/kid', {state:{loginType:'family'}})} className='w-full mx-auto flex justify-between items-center p-4 md:p-8 rounded-lg bg-[#f0eef1] text-[#a94ef3] cursor-pointer'>
|
||||||
|
<div className='flex items-center gap-4'>
|
||||||
|
<img className='w-12 h-auto' src={KidIcon} alt='login key' />
|
||||||
|
<p className='text-lg font-semibold'>Kids or Teens</p>
|
||||||
|
</div>
|
||||||
|
{/* <span>></span> */}
|
||||||
|
<i className="fa-solid fa-caret-right"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="text-gray-400 font-medium text-[16.25px] leading-[24.375px]">
|
||||||
|
Don't have an account?{" "}
|
||||||
|
<Link
|
||||||
|
to="/signup"
|
||||||
|
className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition"
|
||||||
|
>
|
||||||
|
Sign Up
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AuthLayout>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -17,12 +17,13 @@ import { updateUserDetails } from "../../../store/UserDetails";
|
|||||||
import ReCAPTCHA from "react-google-recaptcha";
|
import ReCAPTCHA from "react-google-recaptcha";
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
// const sessionExpired = queryParams.get("sessionExpired");
|
// const sessionExpired = queryParams.get("sessionExpired");
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
const { state } = useLocation();
|
|
||||||
|
|
||||||
const [sessionExpired, setSessionExpired] = useState(queryParams.get("sessionExpired"))
|
const [sessionExpired, setSessionExpired] = useState(queryParams.get("sessionExpired"))
|
||||||
|
|
||||||
@@ -220,7 +221,7 @@ export default function Login() {
|
|||||||
let loginValue = readCookie("loginType");
|
let loginValue = readCookie("loginType");
|
||||||
setLoginType(loginValue);
|
setLoginType(loginValue);
|
||||||
|
|
||||||
if (state?.error) {
|
if (location?.state?.error) {
|
||||||
//check if the login path has an error state indicating any social handle login with error
|
//check if the login path has an error state indicating any social handle login with error
|
||||||
setMsgError("Unexpected Error, Please try again soon.");
|
setMsgError("Unexpected Error, Please try again soon.");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ 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 Login() {
|
export default function Login() {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
// const sessionExpired = queryParams.get("sessionExpired");
|
// const sessionExpired = queryParams.get("sessionExpired");
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
const { state } = useLocation();
|
|
||||||
|
|
||||||
const [sessionExpired, setSessionExpired] = useState(
|
const [sessionExpired, setSessionExpired] = useState(
|
||||||
queryParams.get("sessionExpired")
|
queryParams.get("sessionExpired")
|
||||||
@@ -33,7 +34,7 @@ export default function Login() {
|
|||||||
|
|
||||||
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
|
const [validCaptcha, setValidCaptcha] = useState({ show: false, valid: "" }); // FOR CAPTCHA
|
||||||
|
|
||||||
let [loginType, setLoginType] = useState("");
|
let [loginType, setLoginType] = useState('');
|
||||||
|
|
||||||
const [loginLoading, setLoginLoading] = useState(false);
|
const [loginLoading, setLoginLoading] = useState(false);
|
||||||
|
|
||||||
@@ -199,43 +200,43 @@ export default function Login() {
|
|||||||
// document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
// document.cookie ="loginType=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
|
||||||
// }, []);
|
// }, []);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useEffect(()=>{
|
||||||
// checks the cookie in order to set the login type before components mounts
|
if(location?.state && location?.state.loginType){
|
||||||
// if(document.cookie.includes("loginType=family")){
|
setLoginType(location?.state.loginType)
|
||||||
// setLoginType('family')
|
}else{
|
||||||
// }else if(document.cookie.includes("loginType=full")){
|
navigate('/login', {replace: true})
|
||||||
// setLoginType('full')
|
|
||||||
// }else{
|
|
||||||
// setLoginType('full')
|
|
||||||
// }
|
|
||||||
function readCookie(cname) {
|
|
||||||
// checks the cookie in order to set the login type before components mounts
|
|
||||||
let name = cname + "=";
|
|
||||||
let decoded_cookie = decodeURIComponent(document.cookie);
|
|
||||||
let carr = decoded_cookie.split(";");
|
|
||||||
for (let i = 0; i < carr.length; i++) {
|
|
||||||
let c = carr[i];
|
|
||||||
while (c.charAt(0) == " ") {
|
|
||||||
c = c.substring(1);
|
|
||||||
}
|
|
||||||
if (c.indexOf(name) == 0) {
|
|
||||||
return c.substring(name.length, c.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "full";
|
|
||||||
}
|
}
|
||||||
let loginValue = readCookie("loginType");
|
},[])
|
||||||
setLoginType(loginValue);
|
|
||||||
|
|
||||||
if (state?.error) {
|
// useLayoutEffect(() => {
|
||||||
//check if the login path has an error state indicating any social handle login with error
|
// function readCookie(cname) {
|
||||||
setMsgError("Unexpected Error, Please try again soon.");
|
// // checks the cookie in order to set the login type before components mounts
|
||||||
setTimeout(() => {
|
// let name = cname + "=";
|
||||||
setMsgError("");
|
// let decoded_cookie = decodeURIComponent(document.cookie);
|
||||||
navigate("/login", { replace: true });
|
// let carr = decoded_cookie.split(";");
|
||||||
}, 4000);
|
// for (let i = 0; i < carr.length; i++) {
|
||||||
}
|
// let c = carr[i];
|
||||||
}, []);
|
// while (c.charAt(0) == " ") {
|
||||||
|
// c = c.substring(1);
|
||||||
|
// }
|
||||||
|
// if (c.indexOf(name) == 0) {
|
||||||
|
// return c.substring(name.length, c.length);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return "full";
|
||||||
|
// }
|
||||||
|
// let loginValue = readCookie("loginType");
|
||||||
|
// 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);
|
||||||
|
// }
|
||||||
|
// }, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setMail("");
|
setMail("");
|
||||||
@@ -259,7 +260,7 @@ export default function Login() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-5">
|
{/* <div className="mb-5">
|
||||||
<Link to="#">
|
<Link to="#">
|
||||||
<img
|
<img
|
||||||
src={WrenchBoard}
|
src={WrenchBoard}
|
||||||
@@ -267,13 +268,13 @@ export default function Login() {
|
|||||||
className="h-10 mx-auto"
|
className="h-10 mx-auto"
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div> */}
|
||||||
{/* <div className="content-wrapper login shadow-md w-10/12 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-10/12 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="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-10/12">
|
<div className="w-10/12">
|
||||||
{/* HIDES THIS IF USER SESSION HAS EXPIRED */}
|
{/* HIDES THIS IF USER SESSION HAS EXPIRED */}
|
||||||
{sessionExpired != "true" && (
|
{sessionExpired != "true" && (
|
||||||
<div className="title-area flex flex-col justify-center items-center relative text-center mb-7">
|
<div className="hidden 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]">
|
||||||
Sign In to WrenchBoard
|
Sign In to WrenchBoard
|
||||||
</h1> */}
|
</h1> */}
|
||||||
@@ -299,7 +300,7 @@ export default function Login() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* switch login component */}
|
{/* switch login component */}
|
||||||
<div className="ml-7 flex justify-start items-center gap-3">
|
<div className="hidden --flex-- ml-7 justify-start items-center gap-3">
|
||||||
<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 ${
|
||||||
@@ -327,6 +328,7 @@ export default function Login() {
|
|||||||
{/* END of switch login component */}
|
{/* END of switch login component */}
|
||||||
|
|
||||||
{/* for login component */}
|
{/* for login component */}
|
||||||
|
<h1 className='pb-2 text-center font-medium text-2xl leading-[24.375px]'>{loginType == 'full' ? 'Login' : 'Kids and Teens'}</h1>
|
||||||
{
|
{
|
||||||
loginType == "full" ? (
|
loginType == "full" ? (
|
||||||
//user login component
|
//user login component
|
||||||
@@ -390,7 +392,7 @@ export default function Login() {
|
|||||||
{msgError}
|
{msgError}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="signin-area mb-3.5">
|
<div className="signin-area">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
name="full"
|
name="full"
|
||||||
@@ -524,10 +526,13 @@ export default function Login() {
|
|||||||
)
|
)
|
||||||
// END of family login compoenent
|
// END of family login compoenent
|
||||||
}
|
}
|
||||||
|
<div className='w-full text-center'>
|
||||||
|
<Link className='text-center block font-semibold text-lg pt-3 tracking-wide' to='/login'>Return</Link>
|
||||||
|
</div>
|
||||||
{/* END of login component */}
|
{/* END of login component */}
|
||||||
|
|
||||||
{/* APP DOWNLOAD STORE */}
|
{/* APP DOWNLOAD STORE */}
|
||||||
<div className="w-full mt-4">
|
<div className="hidden w-full mt-4">
|
||||||
<div className="w-full flex justify-center items-center gap-4">
|
<div className="w-full flex justify-center items-center gap-4">
|
||||||
<div className="w-32 lg:w-48">
|
<div className="w-32 lg:w-48">
|
||||||
<a
|
<a
|
||||||
@@ -568,7 +573,7 @@ export default function Login() {
|
|||||||
|
|
||||||
{loginType == "full" && (
|
{loginType == "full" && (
|
||||||
<>
|
<>
|
||||||
<div className="pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
<div className="hidden pt-5 text-[#181c32] text-center font-semibold text-[13.975px] leading-[20.9625px]">
|
||||||
This site is protected by a Captcha. <br />Our Privacy Policy and
|
This site is protected by a Captcha. <br />Our Privacy Policy and
|
||||||
Terms of Service apply.
|
Terms of Service apply.
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -107,15 +107,6 @@ export default function Promo() {
|
|||||||
return (
|
return (
|
||||||
<PromoPageLayout>
|
<PromoPageLayout>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-5">
|
|
||||||
<Link to="#">
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
{requestStatus.loading ?
|
{requestStatus.loading ?
|
||||||
<div className='flex flex-col justify-center items-center'>
|
<div className='flex flex-col justify-center items-center'>
|
||||||
<LoadingSpinner height='h-40' size='8' />
|
<LoadingSpinner height='h-40' size='8' />
|
||||||
@@ -178,47 +169,7 @@ export default function Promo() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/* APP DOWNLOAD STORE */}
|
|
||||||
<div className="w-full mt-4">
|
|
||||||
<div className="w-full flex justify-center items-center gap-4">
|
|
||||||
<div className="w-32 lg:w-48">
|
|
||||||
<a
|
|
||||||
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
|
||||||
>
|
|
||||||
{/* <i className="fa-brands fa-apple text-3xl"></i>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="text-[11px]">Available on the</span>
|
|
||||||
<span className="text-[12px] lg:text-base">
|
|
||||||
App Store
|
|
||||||
</span>
|
|
||||||
</div> */}
|
|
||||||
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="w-32 lg:w-48">
|
|
||||||
<a
|
|
||||||
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
|
||||||
>
|
|
||||||
{/* <i className="fa-brands fa-google-play text-2xl"></i>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="text-[11px]">Available on the</span>
|
|
||||||
<span className="text-[12px] lg:text-base">
|
|
||||||
Google Play
|
|
||||||
</span>
|
|
||||||
</div> */}
|
|
||||||
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<ErrorComponent onClick={() => navigate("/login")} />
|
<ErrorComponent onClick={() => navigate("/login")} />
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import InputCom from "../../Helpers/Inputs/InputCom";
|
|||||||
import AuthLayout from "../AuthLayout";
|
import AuthLayout from "../AuthLayout";
|
||||||
|
|
||||||
export default function SignUp() {
|
export default function SignUp() {
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
const {pathname} = useLocation()
|
const currentPath = country ? `${location?.pathname}?cnt=${country.toLowerCase()}`:location?.pathname // Determines the new pathname is country query params exist
|
||||||
const currentPath = country ? `${pathname}?cnt=${country.toLowerCase()}`:pathname // Determines the new pathname is country query params exist
|
|
||||||
|
|
||||||
const [signUpLoading, setSignUpLoading] = useState(false);
|
const [signUpLoading, setSignUpLoading] = useState(false);
|
||||||
const [checked, setValue] = useState(false);
|
const [checked, setValue] = useState(false);
|
||||||
|
|||||||
@@ -8,15 +8,16 @@ 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();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
const { pathname } = useLocation();
|
|
||||||
const currentPath = country
|
const currentPath = country
|
||||||
? `${pathname}?cnt=${country.toLowerCase()}`
|
? `${location?.pathname}?cnt=${country.toLowerCase()}`
|
||||||
: pathname; // Determines the new pathname is country query params exist
|
: location?.pathname; // Determines the new pathname is country query params exist
|
||||||
|
|
||||||
const [signUpLoading, setSignUpLoading] = useState(false);
|
const [signUpLoading, setSignUpLoading] = useState(false);
|
||||||
const [checked, setValue] = useState(false);
|
const [checked, setValue] = useState(false);
|
||||||
@@ -27,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: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -157,15 +158,6 @@ export default function SignUp() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-5">
|
|
||||||
<Link to={currentPath}>
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-10/12">
|
<div className="w-10/12">
|
||||||
<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">
|
||||||
@@ -210,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">
|
||||||
@@ -221,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>
|
||||||
@@ -233,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">
|
||||||
@@ -280,12 +275,12 @@ export default function SignUp() {
|
|||||||
</button>
|
</button>
|
||||||
<span
|
<span
|
||||||
onClick={rememberMe}
|
onClick={rememberMe}
|
||||||
className="cursor-default text-dark-gray dark:text-white text-[15px] group-checked:text-white transition-all duration-200 group-checked:cursor-default"
|
className="cursor-default text-gray-400 font-medium text-[16.25px] leading-[24.375px] group-checked:text-white transition-all duration-200 group-checked:cursor-default"
|
||||||
>
|
>
|
||||||
I agree with all
|
I agree with all
|
||||||
<Link
|
<Link
|
||||||
href="#"
|
href="#"
|
||||||
className="text-base text-[#4687ba] hover:text-[#009ef7] mx-1 inline-block"
|
className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition mx-1 inline-block"
|
||||||
>
|
>
|
||||||
terms and condition
|
terms and condition
|
||||||
</Link>
|
</Link>
|
||||||
@@ -346,46 +341,6 @@ export default function SignUp() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* APP DOWNLOAD STORE */}
|
|
||||||
<div className="w-full mt-4">
|
|
||||||
<div className="w-full flex justify-center items-center gap-4">
|
|
||||||
<div className="w-32 lg:w-48">
|
|
||||||
<a
|
|
||||||
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
|
||||||
>
|
|
||||||
{/* <i className="fa-brands fa-apple text-3xl"></i>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="text-[11px]">Available on the</span>
|
|
||||||
<span className="text-[12px] lg:text-base">
|
|
||||||
App Store
|
|
||||||
</span>
|
|
||||||
</div> */}
|
|
||||||
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="w-32 lg:w-48">
|
|
||||||
<a
|
|
||||||
// className="px-1 py-1 lg:py-2 flex justify-center items-center gap-1 w-full rounded-md bg-black text-white hover:text-slate-500 hover:shadow-lg transition-all duration-300"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
|
||||||
>
|
|
||||||
{/* <i className="fa-brands fa-google-play text-2xl"></i>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<span className="text-[11px]">Available on the</span>
|
|
||||||
<span className="text-[12px] lg:text-base">
|
|
||||||
Google Play
|
|
||||||
</span>
|
|
||||||
</div> */}
|
|
||||||
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ 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);
|
// console.log("TESTING VERIFY", data);
|
||||||
if (
|
if (
|
||||||
data &&
|
data &&
|
||||||
data.internal_return >= 0 &&
|
data.internal_return >= 0 &&
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ 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);
|
// console.log("TESTING VERIFY", data);
|
||||||
if (
|
if (
|
||||||
data &&
|
data &&
|
||||||
data.internal_return >= 0 &&
|
data.internal_return >= 0 &&
|
||||||
@@ -137,15 +137,6 @@ export default function VerifyLink() {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
|
||||||
<Link to="#">
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-10/12">
|
<div className="w-10/12">
|
||||||
<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">
|
||||||
|
|||||||
@@ -139,15 +139,6 @@ const VerifyPassword = () => {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
|
||||||
<Link to="#">
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
{requestStatus.loading ? (
|
{requestStatus.loading ? (
|
||||||
<LoadingSpinner color="sky-blue" size="16" height="h-300px" />
|
<LoadingSpinner color="sky-blue" size="16" height="h-300px" />
|
||||||
|
|||||||
@@ -8,15 +8,6 @@ export default function VerifyYou() {
|
|||||||
<>
|
<>
|
||||||
<AuthLayout slogan="Welcome to WrenchBoard">
|
<AuthLayout slogan="Welcome to WrenchBoard">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<div className="mb-12">
|
|
||||||
<Link to="#">
|
|
||||||
<img
|
|
||||||
src={WrenchBoard}
|
|
||||||
alt="wrenchboard"
|
|
||||||
className="h-10 mx-auto"
|
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex place-content-center">
|
<div className="flex place-content-center">
|
||||||
<div className="w-10/12">
|
<div className="w-10/12">
|
||||||
<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">
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useSelector } from "react-redux";
|
||||||
|
import { useNavigate, useLocation } from "react-router-dom";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import CommonHead from "../UserHeader/CommonHead";
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
|
||||||
|
|
||||||
export default function BlogItem(props) {
|
export default function BlogItem(props) {
|
||||||
|
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
const {
|
const {
|
||||||
userDetails: { account_type },
|
userDetails: { account_type },
|
||||||
} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details account type
|
} = useSelector((state) => state?.userDetails); // CHECKS IF USER Details account type
|
||||||
@@ -26,7 +28,7 @@ export default function BlogItem(props) {
|
|||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const blog_id = queryParams.get("blog_id");
|
const blog_id = queryParams.get("blog_id");
|
||||||
|
|
||||||
// console.log('MUMU', 'meta_value', blogdata, blogdata.data.image_url)
|
// ('MUMU', 'meta_value', blogdata, blogdata.data.image_url)
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(!blog_id){
|
if(!blog_id){
|
||||||
|
|||||||
@@ -23,17 +23,19 @@ export default function ProductCardStyleTwo({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`card-style-two w-full h-[336px] p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
className={`card-style-two w-full p-[20px] bg-white dark:bg-dark-white rounded-2xl section-shadow ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="flex flex-col justify-between w-full h-full">
|
<div className="flex flex-col justify-between w-full h-full">
|
||||||
<div className="thumbnail-area w-full">
|
<div className="thumbnail-area w-full">
|
||||||
<div
|
<div
|
||||||
className="w-full h-[236px] p-6 rounded-xl overflow-hidden"
|
className="w-full h-[140px] p-6 rounded-lg overflow-hidden"
|
||||||
style={{
|
style={{
|
||||||
// background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
// background: `url(${`https://blog.wrenchboard.com/wp-content/uploads/${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||||
background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
// background: `url(${`${bg}${datas.meta_value}`}) 0% 0% / cover no-repeat`,
|
||||||
|
background: `url(${`${bg}${datas.meta_value}`}) no-repeat`,
|
||||||
|
backgroundSize: '100%',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="product-two-options flex justify-between mb-5 relative">
|
<div className="product-two-options flex justify-between mb-5 relative">
|
||||||
@@ -50,7 +52,7 @@ export default function ProductCardStyleTwo({
|
|||||||
</div>
|
</div>
|
||||||
<div className="details-area">
|
<div className="details-area">
|
||||||
{/* title */}
|
{/* title */}
|
||||||
<Link to={`/blog-page?blog_id=${datas.ID}`} className="mb-2.5" rel="noreferrer">
|
<Link to={`/blog-page?blog_id=${datas.ID}`} className="py-2 mb-2.5" rel="noreferrer">
|
||||||
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
<h1 className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize">
|
||||||
{datas.post_title || "dummy title..."}
|
{datas.post_title || "dummy title..."}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -83,7 +84,7 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
if(message.action == "REFRESH_OFFERS" && message.audience == "MERCHANT" && message.market_uid == user_uid){ // for refreshing job owner offer interest list when any worker sends interest
|
if(message.action == "REFRESH_OFFERS" && message.audience == "MERCHANT" && message.market_uid == user_uid){ // for refreshing job owner offer interest list when any worker sends interest
|
||||||
dispatch(tableReload({type:'OFFERINTERESTLISTRELOAD'}))
|
dispatch(tableReload({type:'OFFERINTERESTLISTRELOAD'}))
|
||||||
}
|
}
|
||||||
console.log('data', data)
|
// console.log('data', data)
|
||||||
});
|
});
|
||||||
// dispatch(tableReload({ type: "HOMEBANNERS" })); // RELOADS HOME BANNERS
|
// dispatch(tableReload({ type: "HOMEBANNERS" })); // RELOADS HOME BANNERS
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ const AssignTaskPopout = ({
|
|||||||
const [formState, setFormState] = useState({
|
const [formState, setFormState] = useState({
|
||||||
// Initialize form state with desired fields
|
// Initialize form state with desired fields
|
||||||
banner: details?.banner || "default.jpg",
|
banner: details?.banner || "default.jpg",
|
||||||
country: details?.country ? details?.country : walletDetails.data.length == 1 ? walletDetails.data[0].country : '',
|
country: details?.country ? details?.country : walletDetails?.data?.length == 1 ? walletDetails?.data[0].country : '',
|
||||||
price: details?.price || "",
|
price: details?.price || "",
|
||||||
title: details?.title || "",
|
title: details?.title || "",
|
||||||
description: details?.description || "",
|
description: details?.description || "",
|
||||||
@@ -115,7 +115,7 @@ const AssignTaskPopout = ({
|
|||||||
let reqData = {};
|
let reqData = {};
|
||||||
if (taskType == "select" && assignType == 'task') {
|
if (taskType == "select" && assignType == 'task') {
|
||||||
// RUNS HERE IF TASK TYPE IS SELECT
|
// RUNS HERE IF TASK TYPE IS SELECT
|
||||||
if (!Object.keys(activeTask.data).length) {
|
if (!Object.keys(activeTask.data)?.length) {
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ const RelativePopout = ({
|
|||||||
const isChecked = relativeSettings?.data?.filter(value => value?.family_uid == item?.family_uid)
|
const isChecked = relativeSettings?.data?.filter(value => value?.family_uid == item?.family_uid)
|
||||||
const image = localStorage.getItem("session_token") ? `${familyList?.imageServer}${localStorage.getItem("session_token")}/family/${item?.family_uid}` : "";
|
const image = localStorage.getItem("session_token") ? `${familyList?.imageServer}${localStorage.getItem("session_token")}/family/${item?.family_uid}` : "";
|
||||||
return (
|
return (
|
||||||
<div key={item.family_uid || index} className="flex items-center border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
<div key={item.family_uid} className="flex items-center border-b dark:border-[#5356fb29] hover:bg-gray-50">
|
||||||
<div className='p-2 flex justify-center items-center'>
|
<div className='p-2 flex justify-center items-center'>
|
||||||
{relativeEditKids.loading && relativeEditKids.family_uid == item.family_uid?
|
{relativeEditKids.loading && relativeEditKids.family_uid == item.family_uid?
|
||||||
<LoadingSpinner size='4' color='bg-sky-500' />
|
<LoadingSpinner size='4' color='bg-sky-500' />
|
||||||
@@ -122,7 +122,7 @@ const RelativePopout = ({
|
|||||||
<div className="flex space-x-2 items-center w-full">
|
<div className="flex space-x-2 items-center w-full">
|
||||||
<div className="min-w-[30px] min-h-[30px] max-w-[30px] max-h-[30px] rounded-full overflow-hidden flex justify-center items-center">
|
<div className="min-w-[30px] min-h-[30px] max-w-[30px] max-h-[30px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
<img
|
<img
|
||||||
src={image || localImgLoad(`images/icons/${banner}`)}
|
src={image || localImgLoad(`images/icons/family.svg`)}
|
||||||
alt={`Avatar`}
|
alt={`Avatar`}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default function FamilyTableNew() {
|
|||||||
const { jobListTable, pendingListTable, parentFamilyTaskList } = useSelector((state) => state.tableReload); // TABLE RELOAD TRIGGERS
|
const { jobListTable, pendingListTable, parentFamilyTaskList } = useSelector((state) => state.tableReload); // TABLE RELOAD TRIGGERS
|
||||||
|
|
||||||
|
|
||||||
let { pathname } = useLocation();
|
let location = useLocation();
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const preSelectedTab = queryParams.get("tab");
|
const preSelectedTab = queryParams.get("tab");
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const FamilyNewWaitlist = ({
|
|||||||
setContinueTaskPopup({ show: false, data: {} });
|
setContinueTaskPopup({ show: false, data: {} });
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Check this >>",continueTaskPopup)
|
// console.log("Check this >>",continueTaskPopup)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -148,18 +148,18 @@ const FamilyWaitlist = memo(
|
|||||||
)}
|
)}
|
||||||
{popUp.show && (
|
{popUp.show && (
|
||||||
<SuggestTask
|
<SuggestTask
|
||||||
details={popUp.data}
|
details={popUp?.data}
|
||||||
onClose={closePopUp}
|
onClose={closePopUp}
|
||||||
continuePopupData={openContinueTaskPopup}
|
continuePopupData={openContinueTaskPopup}
|
||||||
situation={popUp.show}
|
situation={popUp?.show}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{continueTaskPopup.show && (
|
{continueTaskPopup.show && (
|
||||||
<AssignTaskPopout
|
<AssignTaskPopout
|
||||||
details={continueTaskPopup.data}
|
details={continueTaskPopup?.data}
|
||||||
action={closeContinueTaskPopup}
|
action={closeContinueTaskPopup}
|
||||||
situation={continueTaskPopup.show}
|
situation={continueTaskPopup?.show}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
jobList={jobList}
|
jobList={jobList}
|
||||||
setActiveTask={setActiveTask}
|
setActiveTask={setActiveTask}
|
||||||
|
|||||||
@@ -0,0 +1,600 @@
|
|||||||
|
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"),
|
||||||
|
// birthYear: Yup.string()
|
||||||
|
// .required("Required"),
|
||||||
|
// birthMonth: Yup.string()
|
||||||
|
// .required("Required"),
|
||||||
|
// birthDay: Yup.string()
|
||||||
|
// .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 VirtualAddCardFamilyPopout = ({ details, onClose, situation, walletItem, familyData }) => {
|
||||||
|
// console.log('PROPS', 'DETAILS', details, 'WALLET', walletItem, 'FAMILYDATA', familyData)
|
||||||
|
|
||||||
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
|
const countryCode = walletItem?.country
|
||||||
|
|
||||||
|
const userApi = new usersService()
|
||||||
|
|
||||||
|
const [requestStatus, setRequestStatus] = useState({loading: false, status:false, message: ''})
|
||||||
|
|
||||||
|
const [allCountries, setAllCountries] = useState({loading: true, data: []}) // VARIABLE TO HOLD COUNTRY LIST
|
||||||
|
|
||||||
|
const [state, setState] = useState({loading: true, data: {}}) // VARIABLE TO HOLD STATE LIST
|
||||||
|
|
||||||
|
|
||||||
|
let initialValues = {
|
||||||
|
// initial values for formik
|
||||||
|
country: countryCode ? countryCode : '',
|
||||||
|
phone_number: '',
|
||||||
|
email: userDetails?.email,
|
||||||
|
firstname: familyData?.firstname,
|
||||||
|
lastname: familyData?.lastname,
|
||||||
|
family_uid: familyData?.uid,
|
||||||
|
birthYear: '',
|
||||||
|
birthMonth: '',
|
||||||
|
birthDay: '',
|
||||||
|
address: '',
|
||||||
|
city: '',
|
||||||
|
// 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,
|
||||||
|
family_uid: values.family_uid,
|
||||||
|
// 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.walletCardFamilyRequest(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
|
||||||
|
userApi.getSignupCountryData().then(res =>{
|
||||||
|
if(!res?.data?.result_list){
|
||||||
|
return setAllCountries({ loading: false, data: [] });
|
||||||
|
}
|
||||||
|
// if(countryCode){
|
||||||
|
// return setAllCountries({ loading: false, data: res?.data?.result_list?.filter(item => item?.code == countryCode) });
|
||||||
|
// }
|
||||||
|
setAllCountries({ loading: false, data: res?.data?.result_list });
|
||||||
|
}).catch(err => {
|
||||||
|
setAllCountries({ loading: false, data: [] });
|
||||||
|
console.log('err', err)
|
||||||
|
})
|
||||||
|
},[])
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
// GET STATE API
|
||||||
|
setState({loading: true, data: {}})
|
||||||
|
userApi.getStateFromCountry({country: countryCode}).then(res =>{
|
||||||
|
if(!res?.data?.country_state){
|
||||||
|
return setState({ loading: false, data: {} });
|
||||||
|
}
|
||||||
|
setState({ loading: false, data: res?.data?.country_state});
|
||||||
|
}).catch(err => {
|
||||||
|
setState({ loading: false, data: {} });
|
||||||
|
console.log('err', err)
|
||||||
|
})
|
||||||
|
},[initialValues.country])
|
||||||
|
|
||||||
|
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='p-4 w-full flex flex-col h-auto md:h-[28rem]'>
|
||||||
|
<div className='pb-4'>
|
||||||
|
<h1 className='text-lg md:text-xl flex gap-1'><span className='font-bold'>Name:</span>{familyData.lastname} {familyData.firstname}</h1>
|
||||||
|
</div>
|
||||||
|
<div className="grid md:grid-cols-2 gap-4">
|
||||||
|
{/* left part */}
|
||||||
|
<div className='w-full flex flex-col gap-4'>
|
||||||
|
<div className="field w-full grid md:grid-cols-5 gap-4">
|
||||||
|
<div className="md:col-span-2 field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="country"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Country</span>
|
||||||
|
{props.errors.country && props.touched.country && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.country}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="country"
|
||||||
|
name="country"
|
||||||
|
value={props.values.country}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
disabled={countryCode ? true : false}
|
||||||
|
>
|
||||||
|
{allCountries.loading ?
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Loading...
|
||||||
|
</option>
|
||||||
|
: allCountries.data?.length > 0 ?
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Select Country
|
||||||
|
</option>
|
||||||
|
{allCountries.data?.map(item => (
|
||||||
|
<option key={item.uid} className="text-slate-500 text-lg" value={item.code}>
|
||||||
|
{item.country}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Not Found
|
||||||
|
</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='md:col-span-3'>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Phone Number"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="w-full input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="phone_number"
|
||||||
|
value={props.values.phone_number}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Email"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
value={props.values.email}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.email && props.touched.email) && props.errors.email}
|
||||||
|
/>
|
||||||
|
<div className="hidden field w-full md:grid-cols-2 gap-4">
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Firstname"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="firstname"
|
||||||
|
value={props.values.firstname}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.firstname && props.touched.firstname) && props.errors.firstname}
|
||||||
|
/>
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Lastname"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="lastname"
|
||||||
|
value={props.values.lastname}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.lastname && props.touched.lastname) && props.errors.lastname}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* hidden section */}
|
||||||
|
<div className="hidden field w-full flex-col gap-4">
|
||||||
|
<p className='job-label'>Date of Birth</p>
|
||||||
|
<div className='xxs:grid-cols-3 gap-4'>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthDay"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Day</span>
|
||||||
|
{props.errors.birthDay && props.touched.birthDay && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthDay}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthDay"
|
||||||
|
name="birthDay"
|
||||||
|
value={props.values.birthDay}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{day.map(item => (
|
||||||
|
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{item}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthMonth"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Month</span>
|
||||||
|
{props.errors.birthMonth && props.touched.birthMonth && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthMonth}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthMonth"
|
||||||
|
name="birthMonth"
|
||||||
|
value={props.values.birthMonth}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{month.map(item => (
|
||||||
|
<option key={item.value} className="text-slate-500 text-lg" value={item.value}>
|
||||||
|
{item.name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthYear"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Year</span>
|
||||||
|
{props.errors.birthYear && props.touched.birthYear && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthYear}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthYear"
|
||||||
|
name="birthYear"
|
||||||
|
value={props.values.birthYear}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{year.map(item => (
|
||||||
|
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{item}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full grid md:grid-cols-3 gap-4">
|
||||||
|
<p className='hidden md:flex w-full md:col-span-1 job-label items-center'>Date of Birth</p>
|
||||||
|
<div className='w-full md:col-span-2 '>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Date of Birth"
|
||||||
|
labelClass="md:hidden tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="date"
|
||||||
|
name="dob"
|
||||||
|
value={props.values.dob}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.dob && props.touched.dob) && props.errors.dob}
|
||||||
|
maxDate={year[0] + '-12-31'}
|
||||||
|
minDate={year[year?.length - 1] + '-01-01'}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* right part */}
|
||||||
|
<div className='w-full p-4 flex flex-col gap-4 bg-blue-200 dark:bg-slate-900 rounded-2xl'>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Address"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="address"
|
||||||
|
value={props.values.address}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.address && props.touched.address) && props.errors.address}
|
||||||
|
/>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="City"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="city"
|
||||||
|
value={props.values.city}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.city && props.touched.city) && props.errors.city}
|
||||||
|
/>
|
||||||
|
{/* <InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="State/Province"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="state"
|
||||||
|
value={props.values.state}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.state && props.touched.state) && props.errors.state}
|
||||||
|
/> */}
|
||||||
|
|
||||||
|
<div className="field w-full grid md:grid-cols-2 gap-4">
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="state"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>State/Province</span>
|
||||||
|
{props.errors.state && props.touched.state && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.state}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="state"
|
||||||
|
name="state"
|
||||||
|
value={props.values.state}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
{state.loading ?
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Loading...
|
||||||
|
</option>
|
||||||
|
: Object.keys(state.data)?.length > 0 ?
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Select State
|
||||||
|
</option>
|
||||||
|
{Object.keys(state.data)?.map((item, index) => (
|
||||||
|
<option key={index} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{state?.data[item]}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Not Found
|
||||||
|
</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Zip Code"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="zipCode"
|
||||||
|
value={props.values.zipCode}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='p-4 w-full job-label'>
|
||||||
|
<div className='flex gap-4 items-center'>
|
||||||
|
<input
|
||||||
|
type='checkbox'
|
||||||
|
name="checked"
|
||||||
|
className='accent-purple w-4 h-4 p-2 text-purple bg-gray-100 border-gray-300 rounded focus:ring-purple'
|
||||||
|
onChange={props.handleChange}
|
||||||
|
/>
|
||||||
|
<p className='text-[14px] text-justify'>
|
||||||
|
I agree with the <span className='text-bue-600'>cardholder </span>
|
||||||
|
terms & conditions {props.errors.checked && props.touched.checked && <span className='text-[12px] text-red-500'>{props.errors.checked}</span>}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</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 VirtualAddCardFamilyPopout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 )
|
||||||
@@ -2,9 +2,31 @@ import React, { useState } from 'react'
|
|||||||
import { localImgLoad } from '../../../../lib'
|
import { localImgLoad } from '../../../../lib'
|
||||||
import { PriceFormatter } from '../../../Helpers/PriceFormatter'
|
import { PriceFormatter } from '../../../Helpers/PriceFormatter'
|
||||||
import FamilyAddFundPopout from './FamilyAddFundPopout'
|
import FamilyAddFundPopout from './FamilyAddFundPopout'
|
||||||
|
import VirtualAddCardFamilyPopout from './VirtualAddCardFamilyPopout'
|
||||||
|
|
||||||
function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
||||||
const [addFundPopout, setAddFundPopout] = useState({ show: false, data: {} })
|
const [addFundPopout, setAddFundPopout] = useState({ show: false, data: {} })
|
||||||
|
// console.log('WALLET', wallet.brand)
|
||||||
|
|
||||||
|
// virtual add card popout
|
||||||
|
const [virtualPopup, setVirtualPopup] = useState({ show: false, data: {} });
|
||||||
|
|
||||||
|
/*OPENS the virtual add card popout*/
|
||||||
|
const openVirtualPopUp = (value) => {
|
||||||
|
setVirtualPopup({
|
||||||
|
show: true,
|
||||||
|
data: { ...value },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Closes the virtual add card popout*/
|
||||||
|
const closeVirtualPopUp = () => {
|
||||||
|
setVirtualPopup({ show: false, data: {} });
|
||||||
|
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||||
|
};
|
||||||
|
|
||||||
|
// console.log('Extra Actions', Object.keys(wallet.extra_actions))
|
||||||
|
let extraActions = Object.keys(wallet.extra_actions) // VARIABLE TO HOLD EXTRA ACTIONS VALUES
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full p-4 bg-[aliceblue] rounded-lg'
|
<div className='w-full p-4 bg-[aliceblue] rounded-lg'
|
||||||
@@ -21,22 +43,33 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full flex flex-col">
|
<div className="w-full flex flex-col">
|
||||||
<div className="w-full flex gap-2">
|
{wallet?.brand && wallet?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
||||||
<p className="text-base md:text-lg text-thin-light-gray tracking-wide">
|
<div className="w-full flex flex-col gap-2">
|
||||||
Balance:
|
{/* <p className="text-base md:text-lg text-thin-light-gray tracking-wide">
|
||||||
</p>
|
Balance:
|
||||||
<p
|
</p> */}
|
||||||
className="text-base md:text-lg font-bold text-purple tracking-wide leading-10"
|
<p className="text-base md:text-lg font-bold text-purple leading-10">
|
||||||
// className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125"
|
{wallet.brand} <span> **** **** ***** </span> {wallet?.card_last4}
|
||||||
>
|
</p>
|
||||||
{PriceFormatter(
|
</div>
|
||||||
Number(wallet.amount) * 0.01,
|
:
|
||||||
wallet.code,
|
<div className="w-full flex gap-2">
|
||||||
wallet.country,
|
<p className="text-base md:text-lg text-thin-light-gray tracking-wide">
|
||||||
""
|
Balance:
|
||||||
)}
|
</p>
|
||||||
</p>
|
<p
|
||||||
</div>
|
className="text-base md:text-lg font-bold text-purple tracking-wide leading-10"
|
||||||
|
// className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125"
|
||||||
|
>
|
||||||
|
{PriceFormatter(
|
||||||
|
Number(wallet.amount) * 0.01,
|
||||||
|
wallet.code,
|
||||||
|
wallet.country,
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
{/* BTN */}
|
{/* BTN */}
|
||||||
<div className='mt-1 flex justify-end items-center gap-2'>
|
<div className='mt-1 flex justify-end items-center gap-2'>
|
||||||
<button
|
<button
|
||||||
@@ -48,13 +81,28 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
|||||||
>
|
>
|
||||||
Add Money
|
Add Money
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
className="w-[150px] h-[48px] rounded-full text-base text-white bg-[#4687ba] hover:bg-[#009ef7]"
|
{/* EXTRA ACTIONS BTN */}
|
||||||
name="plan"
|
{(extraActions && extraActions?.length > 0) &&
|
||||||
// onClick={onClose}
|
extraActions.map((action, index) => (
|
||||||
>
|
<div key={index}>
|
||||||
Add Card
|
<button
|
||||||
</button>
|
onClick={() => {
|
||||||
|
action == 'ADD_VIRTUAL_CARD' ?
|
||||||
|
openVirtualPopUp({wallet})
|
||||||
|
:
|
||||||
|
()=>{}
|
||||||
|
}}
|
||||||
|
className={`w-[150px] h-[48px] rounded-full text-base text-white bg-[#4687ba] hover:bg-[#009ef7]`}
|
||||||
|
>
|
||||||
|
{/* Add Card */}
|
||||||
|
{wallet?.extra_actions?.[action][0]?.text}
|
||||||
|
</button>
|
||||||
|
{/* <WalletExtraFamilyActionBtn /> // TO BE USED lATER IF NEED BE */}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,6 +119,17 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
|||||||
familyData={familyData}
|
familyData={familyData}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{/* VIRTUAL CARD POPOUT */}
|
||||||
|
{virtualPopup.show && (
|
||||||
|
<VirtualAddCardFamilyPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={wallet}
|
||||||
|
onClose={closeVirtualPopUp}
|
||||||
|
situation={virtualPopup.show}
|
||||||
|
familyData={familyData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ const SuggestTask = ({ details, onClose, situation, continuePopupData }) => {
|
|||||||
setSuggestedNextStep(value);
|
setSuggestedNextStep(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedImage = details?.selectedImage || DEFAULT_IMAGE;
|
// const selectedImage = details?.selectedImage || DEFAULT_IMAGE;
|
||||||
|
const selectedImage = require(`../../assets/images/family/${details ? details.banner : 'default.jpg'}`);
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
title: details?.title || "",
|
title: details?.title || "",
|
||||||
description: details?.description || "",
|
description: details?.description || "",
|
||||||
|
|||||||
+109
-100
@@ -6,15 +6,15 @@ import FamilyActiveLSlde from "./FamilyActiveLSlde";
|
|||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { tableReload } from "../../store/TableReloads";
|
import { tableReload } from "../../store/TableReloads";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
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 userApi = new usersService();
|
const userApi = new usersService();
|
||||||
|
|
||||||
// const trending = MyActiveJobList;
|
|
||||||
|
|
||||||
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
||||||
|
|
||||||
@@ -22,121 +22,130 @@ 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 (
|
||||||
<div>
|
<>
|
||||||
<div className="home-page-wrapper">
|
<div>
|
||||||
{/* Header */}
|
<div className="home-page-wrapper">
|
||||||
<div className="text-white mb-4 min-h-[3rem] px-2 w-full flex justify-between items-center rounded-xl bg-family-header-bg">
|
{/* Header */}
|
||||||
<div className="w-full">
|
<div className="text-white mb-4 min-h-[3rem] px-2 w-full flex justify-between items-center rounded-xl bg-family-header-bg">
|
||||||
<div className="w-full flex flex-wrap gap-x-4 ">
|
<div className="w-full">
|
||||||
<p className="text-lg font-normal leading-5">Welcome</p>
|
<div className="w-full flex flex-wrap gap-x-4 ">
|
||||||
<div className="">
|
<p className="text-lg font-normal leading-5">Welcome</p>
|
||||||
<h1 className="text-lg font-normal leading-5">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
<div className="">
|
||||||
|
<h1 className="text-lg font-normal leading-5">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="py-1 w-full text-sm text-right self-end">
|
||||||
|
<p className="leading-4">Last Login: {`${userDetails?.last_login.split(' ')[0]}`}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="py-1 w-full text-sm text-right self-end">
|
|
||||||
<p className="leading-4">Last Login: {`${userDetails?.last_login.split(' ')[0]}`}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{process.env.REACT_APP_SHOW_NEW_FAMILY_DASH == '1' &&
|
{process.env.REACT_APP_SHOW_NEW_FAMILY_DASH == '1' &&
|
||||||
<>
|
<>
|
||||||
{familyBannersList?.loading ?
|
{familyBannersList?.loading ?
|
||||||
<div className="w-full bg-white rounded-2xl">
|
<div className="w-full bg-white rounded-2xl">
|
||||||
<LoadingSpinner size='10' color='sky-blue' height='h-[20rem]' />
|
<LoadingSpinner size='10' color='sky-blue' height='h-[20rem]' />
|
||||||
</div>
|
|
||||||
:
|
|
||||||
familyBannersList?.result_list && Object.keys(familyBannersList?.result_list).length > 0 ?
|
|
||||||
// Loop for Family Banners
|
|
||||||
<div className="w-full mb-4 grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4">
|
|
||||||
{Object.keys(familyBannersList?.result_list).map((item, index) => {
|
|
||||||
let content = familyBannersList?.result_list[item]
|
|
||||||
// let action = item == 'recommend' ? 'familymarket' : 'mytask'
|
|
||||||
return (
|
|
||||||
<Link key={item} to={`/${content.banner.action}`} className={`rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
|
||||||
<div className="h-full w-full">
|
|
||||||
<img className="w-full h-[10rem] object-cover rounded-t-xl" src={content.banner.image} alt='banner image' />
|
|
||||||
<div className="flex flex-col justify-between">
|
|
||||||
<div className="px-2 py-2 border-b border-transparent min-h-[4rem] flex flex-col gap-1">
|
|
||||||
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{content.banner.text}</h1>
|
|
||||||
<p className="text-sm text-black dark:text-white">{content.banner.description}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
null
|
familyBannersList?.result_list && Object.keys(familyBannersList?.result_list).length > 0 ?
|
||||||
}
|
// Loop for Family Banners
|
||||||
|
<div className="w-full mb-4 grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4">
|
||||||
{tab_categories?.data &&
|
{Object.keys(familyBannersList?.result_list).map((item, index) => {
|
||||||
<div className="mb-4">
|
let content = familyBannersList?.result_list[item]
|
||||||
<h1 className="my-4 text-26 font-bold text-dark-gray dark:text-white tracking-wide">Resources</h1>
|
// let action = item == 'recommend' ? 'familymarket' : 'mytask'
|
||||||
<div className="w-full grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-4">
|
return (
|
||||||
{tab_categories.data.map((item) => {
|
<Link key={item} to={`/${content.banner.action}`} className={`rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
||||||
// if(item.enabled){
|
<div className="h-full w-full">
|
||||||
// }
|
<img className="w-full h-[10rem] object-cover rounded-t-xl" src={content.banner.image} alt='banner image' />
|
||||||
return (
|
<div className="flex flex-col justify-between">
|
||||||
<Link key={item.uid} to={`/${item?.action}`} className={`group rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
<div className="px-2 py-2 border-b border-transparent min-h-[4rem] flex flex-col gap-1">
|
||||||
<div className="h-full w-full">
|
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{content.banner.text}</h1>
|
||||||
<div className="w-full h-[8rem] rounded-t-xl overflow-hidden">
|
<p className="text-sm text-black dark:text-white">{content.banner.description}</p>
|
||||||
<img className="w-full h-full group-hover:scale-110 object-cover transition-all duration-300" src={item?.banner} alt='banner image' />
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col justify-between">
|
|
||||||
<div className="px-2 py-1 border-b border-transparent min-h-[2rem] flex justify-between items-center gap-1">
|
|
||||||
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{item?.content}</h1>
|
|
||||||
<div className="flex justify-center gap-1">
|
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
|
||||||
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Link>
|
||||||
</Link>
|
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
{tab_categories?.data &&
|
||||||
|
<div className="mb-4">
|
||||||
|
<h1 className="my-4 text-26 font-bold text-dark-gray dark:text-white tracking-wide">Resources</h1>
|
||||||
|
<div className="w-full grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-4">
|
||||||
|
{tab_categories.data.map((item) => {
|
||||||
|
// if(item.enabled){
|
||||||
|
// }
|
||||||
|
return (
|
||||||
|
<Link key={item.uid} to={`/${item?.action}`} className={`group rounded-xl bg-white dark:bg-dark-white shadow-md flex justify-center items-center transition-all duration-300 hover:shadow-sm`}>
|
||||||
|
<div className="h-full w-full">
|
||||||
|
<div className="w-full h-[8rem] rounded-t-xl overflow-hidden">
|
||||||
|
<img className="w-full h-full group-hover:scale-110 object-cover transition-all duration-300" src={item?.banner} alt='banner image' />
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col justify-between">
|
||||||
|
<div className="px-2 py-1 border-b border-transparent min-h-[2rem] flex justify-between items-center gap-1">
|
||||||
|
<h1 className="text-lg text-[#083e21] dark:text-white font-bold tracking-wide">{item?.content}</h1>
|
||||||
|
<div className="flex justify-center gap-1">
|
||||||
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
|
<div className="w-1 h-1 bg-slate-400 rounded-full"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</>
|
|
||||||
}
|
|
||||||
|
|
||||||
{/* {familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
|
{/* {familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
|
||||||
<MyOffersFamilyTable
|
<MyOffersFamilyTable
|
||||||
familyOffers={familyOffers?.result_list}
|
familyOffers={familyOffers?.result_list}
|
||||||
image_server={familyOffers?.session_image_server}
|
image_server={familyOffers?.session_image_server}
|
||||||
className="mb-10"
|
className="mb-10"
|
||||||
/>
|
/>
|
||||||
)} */}
|
)} */}
|
||||||
|
|
||||||
{/* {trending && trending.length > 0 && (
|
{/* {trending && trending.length > 0 && (
|
||||||
<FamilyActiveLSlde
|
<FamilyActiveLSlde
|
||||||
trending={trending}
|
trending={trending}
|
||||||
className="mb-10"
|
className="mb-10"
|
||||||
image_server={serverImg}
|
image_server={serverImg}
|
||||||
/>
|
/>
|
||||||
)} */}
|
)} */}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
{/* last_login */}
|
||||||
|
|
||||||
|
{(!familyBannersList?.loading && firstTimeModal) &&
|
||||||
|
<HomeModal userDetails={userDetails} action={()=>setFirstTimeModal(prev => !prev)} situation={firstTimeModal} />
|
||||||
|
}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default function HomeActivities({ className }) {
|
|||||||
getRecentActivities();
|
getRecentActivities();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log(recentActivitiesData);
|
// console.log(recentActivitiesData);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import ModalCom from '../Helpers/ModalCom'
|
||||||
|
import ModalBG from '../../assets/images/modalbg.png'
|
||||||
|
|
||||||
|
export default function HomeModal({userDetails, action, situation}) {
|
||||||
|
|
||||||
|
const {firstname, lastname} = userDetails
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
'Suggest Task to Parent', 'Suggest Task to Parent'
|
||||||
|
]
|
||||||
|
|
||||||
|
const onSelectOption = () => {
|
||||||
|
action()
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className=''>
|
||||||
|
<div className='fixed top-0 left-0 bottom-0 w-full bg-black bg-opacity-40 backdrop-filter backdrop-blur-sm z-50'></div>
|
||||||
|
<div className='fixed h-full z-[99999999999999] w-full lg:w-auto inset-0 flex flex-col justify-center items-center overflow-y-auto'>
|
||||||
|
<div className="relative w-11/12 md:w-[600px] lg:w-[992px] rounded-2xl overflow-hidden">
|
||||||
|
<div className='relative p-4 bg-sky-blue flex items-center'>
|
||||||
|
<img className='block w-2/3 max-w-lg mx-auto' src={ModalBG} alt='modal image' />
|
||||||
|
<div className='absolute text-white top-5 right-5'>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="text-white"
|
||||||
|
onClick={onSelectOption}
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
<div className='p-4 bg-slate-100'>
|
||||||
|
<div className='w-2/3 max-w-5xl mx-auto flex flex-col gap-4 tracking-wider'>
|
||||||
|
{/* <h1 className='text-3xl'>Welcome to <span className='font-semibold'>WrenchBoard</span></h1> */}
|
||||||
|
<h1 className='text-3xl'>Welcome <span className='font-semibold'>{firstname} {lastname}</span></h1>
|
||||||
|
<p className='text-2xl'>
|
||||||
|
Here's where you can explore informative vidoes that provide valuable insight
|
||||||
|
into <span className='font-semibold'>how you can connect with siblings and family and explore more on personal development</span>
|
||||||
|
</p>
|
||||||
|
<div className='self-end'>
|
||||||
|
<button onClick={onSelectOption} className='bg-sky-blue px-4 py-2 text-xl text-white rounded-lg'>Done</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -2,93 +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>
|
||||||
}
|
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function LockJob({
|
|||||||
apiCall
|
apiCall
|
||||||
.getVerifyCompletedTask({ offer_depend_uid: details?.offer_depend_uid })
|
.getVerifyCompletedTask({ offer_depend_uid: details?.offer_depend_uid })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("RES", res.data);
|
// console.log("RES", res.data);
|
||||||
setCompletedTask({ loading: false, data: res?.data?.result_list });
|
setCompletedTask({ loading: false, data: res?.data?.result_list });
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
import { useSelector } from "react-redux";
|
import {useEffect} from 'react'
|
||||||
|
import { useSelector, useDispatch} from "react-redux";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import CommonHead from "../UserHeader/CommonHead";
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
import MainSection from "./MainSection";
|
import MainSection from "./MainSection";
|
||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
export default function MarketPlace({ commonHeadData }) {
|
export default function MarketPlace({ commonHeadData }) {
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
let { jobLists } = useSelector((state) => state.jobLists);
|
let { jobLists } = useSelector((state) => state.jobLists);
|
||||||
const marketData = jobLists?.result_list;
|
const marketData = jobLists?.result_list;
|
||||||
const categories = jobLists?.categories;
|
const categories = jobLists?.categories;
|
||||||
const image_server = jobLists?.session_image_server;
|
const image_server = jobLists?.session_image_server;
|
||||||
|
// console.log('Lenth', marketData?.length )
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!jobLists.loading && (marketData?.length < 1 || !marketData)){
|
||||||
|
dispatch(tableReload({ type: "MARKETTABLELIST" })); // reloads market page
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -10,13 +10,14 @@ import ActiveJobMessageMedia from "./ActiveJobMessageMedia";
|
|||||||
import IndexJobActions from "./JobActions/IndexJobActions";
|
import IndexJobActions from "./JobActions/IndexJobActions";
|
||||||
import MediaLayout from "../Partials/MediaLayout";
|
import MediaLayout from "../Partials/MediaLayout";
|
||||||
|
|
||||||
const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
|
|
||||||
|
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
import { SocketValues } from "../Contexts/SocketIOContext";
|
import { SocketValues } from "../Contexts/SocketIOContext";
|
||||||
import TabButton from "../customTabs/TabButton";
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
|
||||||
|
const VideoElement = lazy(() => import("../VideoCom/VideoElement"));
|
||||||
|
|
||||||
|
|
||||||
function ActiveJobsMedia(props) {
|
function ActiveJobsMedia(props) {
|
||||||
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {sendMessage, joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default function MyActiveJobs(props) {
|
|||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
};
|
};
|
||||||
console.log("AMEYE LOC1", props.MyJobList);
|
// console.log("AMEYE LOC1", props.MyJobList);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default function MyOffersTable({ className, MyActiveOffersList }) {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("YES WE SEE OFFERS", MyActiveOffersList);
|
// console.log("YES WE SEE OFFERS", MyActiveOffersList);
|
||||||
const sellSlider = useRef(null);
|
const sellSlider = useRef(null);
|
||||||
//const buySlider = useRef(null);
|
//const buySlider = useRef(null);
|
||||||
const prevHandler = (value) => {
|
const prevHandler = (value) => {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default function MyTasks({
|
|||||||
|
|
||||||
let accountType = userDetails?.account_type == "FULL"
|
let accountType = userDetails?.account_type == "FULL"
|
||||||
|
|
||||||
console.log("Active something >>", MyActiveOffersList)
|
// console.log("Active something >>", MyActiveOffersList)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default function MyWaitingJobs(props) {
|
|||||||
const filterHandler = (value) => {
|
const filterHandler = (value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
};
|
};
|
||||||
console.log("AMEYE LOC1", props.MyJobList);
|
// console.log("AMEYE LOC1", props.MyJobList);
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<CommonHead
|
<CommonHead
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
height="min-h-[240px]"
|
height="min-h-[240px]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : wallet?.data.length > 0 ? (
|
) : wallet?.data?.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
{wallet?.data?.length > 1 && (
|
{wallet?.data?.length > 1 && (
|
||||||
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
|
<div className="wal-selection px-5 py-2 text-black dark:text-white flex items-center gap-2">
|
||||||
@@ -87,6 +87,11 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
<p className="text-base sm:text-lg text-white tracking-wide my-3 text-center">
|
<p className="text-base sm:text-lg text-white tracking-wide my-3 text-center">
|
||||||
Current Balance
|
Current Balance
|
||||||
</p>
|
</p>
|
||||||
|
{selectedWallet?.brand && selectedWallet?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
||||||
|
<p className="text-2xl font-bold text-white dark:text-white leading-10">
|
||||||
|
{selectedWallet.brand} <span> **** **** ***** </span> {selectedWallet?.card_last4}
|
||||||
|
</p>
|
||||||
|
:
|
||||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
||||||
{PriceFormatter(
|
{PriceFormatter(
|
||||||
selectedWallet?.amount / 100,
|
selectedWallet?.amount / 100,
|
||||||
@@ -95,6 +100,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
"text-[2rem]"
|
"text-[2rem]"
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const FamilyWalletCon = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getPaymentHistory();
|
// getPaymentHistory();
|
||||||
getFamilyWalletBal()
|
getFamilyWalletBal()
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ const FamilyWalletCon = () => {
|
|||||||
}>
|
}>
|
||||||
<FamilyWalletBox
|
<FamilyWalletBox
|
||||||
wallet={familyWalletBal}
|
wallet={familyWalletBal}
|
||||||
payment={paymentHistory}
|
// payment={paymentHistory}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</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,11 +1,14 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import WalletBox from "./WalletBox";
|
import WalletBox from "./WalletBox";
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
const WalletRoutes = () => {
|
const WalletRoutes = () => {
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const apiCall = new usersService();
|
const apiCall = new usersService();
|
||||||
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
const { walletDetails } = useSelector((state) => state?.walletDetails); // WALLET STORE
|
||||||
const { walletTable } = useSelector((state) => state.tableReload);
|
const { walletTable } = useSelector((state) => state.tableReload);
|
||||||
@@ -60,6 +63,12 @@ const WalletRoutes = () => {
|
|||||||
getPaymentHistory();
|
getPaymentHistory();
|
||||||
}, [walletTable]);
|
}, [walletTable]);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!walletDetails.loading && walletDetails?.data?.length < 1){
|
||||||
|
dispatch(tableReload({ type: "WALLETTABLE" })); // reloads wallet page
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<WalletBox
|
<WalletBox
|
||||||
|
|||||||
@@ -2,8 +2,28 @@ import React, { useEffect, useState } from "react";
|
|||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
import ConfirmNairaWithdraw from "./Popup/ConfirmNairaWithdraw";
|
||||||
import NairaWithdraw from "./Popup/NairaWithdraw";
|
import NairaWithdraw from "./Popup/NairaWithdraw";
|
||||||
|
import VirtualAddCardPopout from "./walletvirtual/VirtualAddCardPopout";
|
||||||
|
import WalletExtraActionBtn from "./WalletExtraActionBtn";
|
||||||
|
|
||||||
function WalletAction({ walletItem, payment, openPopUp }) {
|
function WalletAction({ walletItem, payment, openPopUp }) {
|
||||||
|
|
||||||
|
// virtual add card popout
|
||||||
|
const [virtualPopup, setVirtualPopup] = useState({ show: false, data: {} });
|
||||||
|
|
||||||
|
/*OPENS the virtual add card popout*/
|
||||||
|
const openVirtualPopUp = (value) => {
|
||||||
|
setVirtualPopup({
|
||||||
|
show: true,
|
||||||
|
data: { ...value },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/*Closes the virtual add card popout*/
|
||||||
|
const closeVirtualPopUp = () => {
|
||||||
|
setVirtualPopup({ show: false, data: {} });
|
||||||
|
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||||
|
};
|
||||||
|
|
||||||
const [showNairaWithdraw, setShowNairaWithdraw] = useState({
|
const [showNairaWithdraw, setShowNairaWithdraw] = useState({
|
||||||
show: false,
|
show: false,
|
||||||
state: {},
|
state: {},
|
||||||
@@ -14,20 +34,39 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
state: {},
|
state: {},
|
||||||
}); // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
|
}); // DETERMINES WHEN CONFIRM NAIRA WITHDRAWAL POPS UP
|
||||||
|
|
||||||
|
// console.log('Extra Actions', Object.keys(walletItem.extra_actions))
|
||||||
|
let extraActions = Object.keys(walletItem.extra_actions) // VARIABLE TO HOLD EXTRA ACTIONS VALUES
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="counters w-full flex justify-between gap-2">
|
<div className="counters w-full flex justify-between gap-2">
|
||||||
|
|
||||||
|
{/* EXTRA ACTIONS BTN */}
|
||||||
<div className="w-1/2 flex justify-start items-center">
|
<div className="w-1/2 flex justify-start items-center">
|
||||||
<button
|
{(extraActions && extraActions?.length > 0) &&
|
||||||
onClick={() => {
|
extraActions.map((action, index) => (
|
||||||
setShowNairaWithdraw((prev) => ({ ...prev, show: true }));
|
<div key={index}>
|
||||||
}}
|
<button
|
||||||
className={`${
|
onClick={() => {
|
||||||
walletItem.code != "NAIRA" && "invisible"
|
action == 'SPEND_FROM_BALANCE' ?
|
||||||
} logout-btn btn-gradient text-white`}
|
setShowNairaWithdraw((prev) => ({ ...prev, show: true }))
|
||||||
>
|
: action == 'ADD_VIRTUAL_CARD' ?
|
||||||
Spend
|
openVirtualPopUp({walletItem})
|
||||||
</button>
|
:
|
||||||
|
()=>{}
|
||||||
|
}}
|
||||||
|
className={`${
|
||||||
|
walletItem?.code != "NAIRA" && ""
|
||||||
|
} logout-btn btn-gradient text-white`}
|
||||||
|
>
|
||||||
|
{/* Spend */}
|
||||||
|
{walletItem?.extra_actions?.[action][0]?.text}
|
||||||
|
</button>
|
||||||
|
{/* <WalletExtraActionBtn /> // TO BE USED lATER */}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-1/2 flex justify-end items-center">
|
<div className="w-1/2 flex justify-end items-center">
|
||||||
<button
|
<button
|
||||||
className="logout-btn btn-gradient text-white"
|
className="logout-btn btn-gradient text-white"
|
||||||
@@ -71,6 +110,17 @@ function WalletAction({ walletItem, payment, openPopUp }) {
|
|||||||
situation={showConfirmNairaWithdraw.show}
|
situation={showConfirmNairaWithdraw.show}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* VIRTUAL CARD POPOUT */}
|
||||||
|
{virtualPopup.show && (
|
||||||
|
<VirtualAddCardPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closeVirtualPopUp}
|
||||||
|
situation={virtualPopup.show}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -9,11 +8,11 @@ import WalletItemCardVirtual from './walletvirtual/WalletItemCardVirtual'
|
|||||||
export default function WalletBox({ wallet, payment, countries }) {
|
export default function WalletBox({ wallet, payment, countries }) {
|
||||||
const { loading, data } = wallet;
|
const { loading, data } = wallet;
|
||||||
|
|
||||||
|
// console.log('LOG', data[0]?.extra_actions?.SPEND_FROM_BALANCE[0])
|
||||||
|
|
||||||
// const { userDetails } = useSelector((state) => state.userDetails);
|
// const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
// const accountType = userDetails?.account_type === "FAMILY";
|
// const accountType = userDetails?.account_type === "FAMILY";
|
||||||
|
|
||||||
// console.log('mumu', data)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="my-wallet-wrapper w-full mb-10">
|
<div className="my-wallet-wrapper w-full mb-10">
|
||||||
<div className="main-wrapper w-full">
|
<div className="main-wrapper w-full">
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default function WalletExtraActionBtn() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* <button
|
||||||
|
onClick={() => {
|
||||||
|
walletItem?.code == 'NAIRA' ? setShowNairaWithdraw((prev) => ({ ...prev, show: true })) : openVirtualPopUp({walletItem})
|
||||||
|
}}
|
||||||
|
className={`${
|
||||||
|
walletItem?.code != "NAIRA" && ""
|
||||||
|
} logout-btn btn-gradient text-white`}
|
||||||
|
>
|
||||||
|
{walletItem?.code == 'NAIRA' ? walletItem?.extra_actions?.SPEND_FROM_BALANCE[0]?.text : walletItem?.extra_actions?.ADD_VIRTUAL_CARD[0]?.text}
|
||||||
|
</button> */}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -58,12 +58,27 @@ export default function WalletHeader(props) {
|
|||||||
props.myWalletList.map((value, index) =>
|
props.myWalletList.map((value, index) =>
|
||||||
{
|
{
|
||||||
let image = value.code ? `${value.code.toLocaleLowerCase()}.svg` : 'default.png'
|
let image = value.code ? `${value.code.toLocaleLowerCase()}.svg` : 'default.png'
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<li
|
<li
|
||||||
key={index}
|
key={value?.wallet_uid || index}
|
||||||
className="content-item py-4 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple dark:hover:border-purple"
|
className="content-item py-4 border-b dark:border-[#5356fb29] border-light-purple hover:border-purple dark:hover:border-purple"
|
||||||
onClick={onWalletClick}
|
onClick={onWalletClick}
|
||||||
>
|
>
|
||||||
|
{value?.brand && value?.card_last4 ? // FOR VIRTUAL CARD NUMBER ELSE WALLET BALANCE DISPLAY
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="account-name flex space-x-4 items-center mb-2 sm:mb-0">
|
||||||
|
<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={value.icon} className="w-14 h-14" alt="currency icon" />
|
||||||
|
</div>
|
||||||
|
<div className="name">
|
||||||
|
<p className="text-2xl font-bold text-dark-gray dark:text-white">
|
||||||
|
{value.brand} <span> **** **** ***** </span> {value?.card_last4}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
<div className="sm:flex justify-between items-center">
|
<div className="sm:flex justify-between items-center">
|
||||||
<div className="account-name flex space-x-4 items-center mb-2 sm:mb-0">
|
<div className="account-name flex space-x-4 items-center mb-2 sm:mb-0">
|
||||||
<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 ">
|
<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 ">
|
||||||
@@ -81,6 +96,7 @@ export default function WalletHeader(props) {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +59,14 @@ 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
|
||||||
|
<p className="text-2xl font-bold text-white dark:text-white leading-10">
|
||||||
|
{walletItem.brand} <span> **** **** ***** </span> {walletItem?.card_last4}
|
||||||
|
</p>
|
||||||
|
:
|
||||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
||||||
{PriceFormatter(
|
{PriceFormatter(
|
||||||
walletItem.amount * 0.01,
|
walletItem.amount * 0.01,
|
||||||
@@ -70,11 +75,12 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
"text-[2rem]"
|
"text-[2rem]"
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</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 :{" "}
|
||||||
@@ -92,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
|
||||||
@@ -100,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 )
|
||||||
@@ -14,8 +14,8 @@ const validationSchema = Yup.object().shape({
|
|||||||
country: Yup.string()
|
country: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
phone_number: Yup.string()
|
phone_number: Yup.string()
|
||||||
.min(9, "Min 9 characters")
|
.min(9, "Invalid")
|
||||||
.max(11, "Max 11 characters")
|
.max(11, "Invalid")
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
// birthYear: Yup.string()
|
// birthYear: Yup.string()
|
||||||
// .required("Required"),
|
// .required("Required"),
|
||||||
@@ -39,13 +39,15 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("Required"),
|
.required("Required"),
|
||||||
dob: Yup.string()
|
dob: Yup.string()
|
||||||
.required("Required"),
|
.required("Required"),
|
||||||
|
checked: Yup.bool() // use bool instead of boolean
|
||||||
|
.oneOf([true], "You must accept the terms and conditions")
|
||||||
});
|
});
|
||||||
|
|
||||||
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state.userDetails);
|
const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
|
||||||
const countryCode = userDetails?.country
|
const countryCode = walletItem?.country
|
||||||
|
|
||||||
const userApi = new usersService()
|
const userApi = new usersService()
|
||||||
|
|
||||||
@@ -70,7 +72,8 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
city: userDetails?.city ? userDetails.city : '',
|
city: userDetails?.city ? userDetails.city : '',
|
||||||
state: '',
|
state: '',
|
||||||
zipCode: '',
|
zipCode: '',
|
||||||
dob: ''
|
dob: '',
|
||||||
|
checked: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -96,6 +99,7 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
let date = new Date(values.dob)
|
||||||
const reqData = {
|
const reqData = {
|
||||||
request_type: '100',
|
request_type: '100',
|
||||||
address: values.address,
|
address: values.address,
|
||||||
@@ -107,9 +111,9 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
// dob_day: values.birthDay,
|
// dob_day: values.birthDay,
|
||||||
// dob_month: values.birthMonth,
|
// dob_month: values.birthMonth,
|
||||||
// dob_year: values.birthYear,
|
// dob_year: values.birthYear,
|
||||||
dob_day: Number(new Date(values.dob).getDate()),
|
dob_day: Number(date.getDate()),
|
||||||
dob_month: Number(new Date(values.dob).getMonth()) + 1,
|
dob_month: Number(date.getMonth()) + 1,
|
||||||
dob_year: Number(new Date(values.dob).getFullYear()),
|
dob_year: Number(date.getFullYear()),
|
||||||
dob: values.dob
|
dob: values.dob
|
||||||
}
|
}
|
||||||
// console.log('Values', reqData)
|
// console.log('Values', reqData)
|
||||||
@@ -177,8 +181,8 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Form className="w-full overflow-y-auto">
|
<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">
|
||||||
<div className="logout-modal-wrapper mx-auto w-[90%] lg:w-[900px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl">
|
<Form className="w-full">
|
||||||
<div className="modal-header-con">
|
<div className="modal-header-con">
|
||||||
<h1 className="modal-title">
|
<h1 className="modal-title">
|
||||||
{walletItem?.description}
|
{walletItem?.description}
|
||||||
@@ -209,321 +213,344 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 w-full grid lg:grid-cols-2 gap-4">
|
<div className='p-4 w-full flex flex-col h-auto md:h-[28rem]'>
|
||||||
{/* left part */}
|
<div className='pb-4'>
|
||||||
<div className='w-full flex flex-col gap-4'>
|
|
||||||
<h1 className='text-lg md:text-xl flex gap-1'><span className='font-bold'>Name:</span>{userDetails.lastname} {userDetails.firstname}</h1>
|
<h1 className='text-lg md:text-xl flex gap-1'><span className='font-bold'>Name:</span>{userDetails.lastname} {userDetails.firstname}</h1>
|
||||||
<div className="field w-full grid md:grid-cols-3 gap-4">
|
</div>
|
||||||
<div className="md:col-span-1 field w-full">
|
<div className="grid md:grid-cols-2 gap-4">
|
||||||
|
{/* left part */}
|
||||||
|
<div className='w-full flex flex-col gap-4'>
|
||||||
|
<div className="field w-full grid md:grid-cols-5 gap-4">
|
||||||
|
<div className="md:col-span-2 field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="country"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Country</span>
|
||||||
|
{props.errors.country && props.touched.country && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.country}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="country"
|
||||||
|
name="country"
|
||||||
|
value={props.values.country}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
disabled={countryCode ? true : false}
|
||||||
|
>
|
||||||
|
{allCountries.loading ?
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Loading...
|
||||||
|
</option>
|
||||||
|
: allCountries.data?.length > 0 ?
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Select Country
|
||||||
|
</option>
|
||||||
|
{allCountries.data?.map(item => (
|
||||||
|
<option key={item.uid} className="text-slate-500 text-lg" value={item.code}>
|
||||||
|
{item.country}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Not Found
|
||||||
|
</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className='md:col-span-3'>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Phone Number"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="w-full input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="phone_number"
|
||||||
|
value={props.values.phone_number}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Email"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
value={props.values.email}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.email && props.touched.email) && props.errors.email}
|
||||||
|
/>
|
||||||
|
<div className="hidden field w-full md:grid-cols-2 gap-4">
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Firstname"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="firstname"
|
||||||
|
value={props.values.firstname}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.firstname && props.touched.firstname) && props.errors.firstname}
|
||||||
|
/>
|
||||||
|
<InputCom
|
||||||
|
disable={true}
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Lastname"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="lastname"
|
||||||
|
value={props.values.lastname}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.lastname && props.touched.lastname) && props.errors.lastname}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* hidden section */}
|
||||||
|
<div className="hidden field w-full flex-col gap-4">
|
||||||
|
<p className='job-label'>Date of Birth</p>
|
||||||
|
<div className='xxs:grid-cols-3 gap-4'>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthDay"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Day</span>
|
||||||
|
{props.errors.birthDay && props.touched.birthDay && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthDay}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthDay"
|
||||||
|
name="birthDay"
|
||||||
|
value={props.values.birthDay}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{day.map(item => (
|
||||||
|
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{item}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthMonth"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Month</span>
|
||||||
|
{props.errors.birthMonth && props.touched.birthMonth && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthMonth}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthMonth"
|
||||||
|
name="birthMonth"
|
||||||
|
value={props.values.birthMonth}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{month.map(item => (
|
||||||
|
<option key={item.value} className="text-slate-500 text-lg" value={item.value}>
|
||||||
|
{item.name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div className="field w-full">
|
||||||
|
<label
|
||||||
|
htmlFor="birthYear"
|
||||||
|
className="job-label job-label-flex"
|
||||||
|
>
|
||||||
|
<span>Year</span>
|
||||||
|
{props.errors.birthYear && props.touched.birthYear && (
|
||||||
|
<span className="text-[12px] text-red-500">
|
||||||
|
{props.errors.birthYear}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="birthYear"
|
||||||
|
name="birthYear"
|
||||||
|
value={props.values.birthYear}
|
||||||
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
|
onChange={props.handleChange}
|
||||||
|
>
|
||||||
|
<>
|
||||||
|
<option className="text-slate-500 text-lg" value=''>
|
||||||
|
select
|
||||||
|
</option>
|
||||||
|
{year.map(item => (
|
||||||
|
<option key={item} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{item}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field w-full grid md:grid-cols-3 gap-4">
|
||||||
|
<p className='hidden md:flex w-full md:col-span-1 job-label items-center'>Date of Birth</p>
|
||||||
|
<div className='w-full md:col-span-2 '>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Date of Birth"
|
||||||
|
labelClass="md:hidden tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="date"
|
||||||
|
name="dob"
|
||||||
|
value={props.values.dob}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.dob && props.touched.dob) && props.errors.dob}
|
||||||
|
maxDate={year[0] + '-12-31'}
|
||||||
|
minDate={year[year?.length - 1] + '-01-01'}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* right part */}
|
||||||
|
<div className='w-full p-4 flex flex-col gap-4 bg-blue-200 dark:bg-slate-900 rounded-2xl'>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="Address"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="address"
|
||||||
|
value={props.values.address}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.address && props.touched.address) && props.errors.address}
|
||||||
|
/>
|
||||||
|
<InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="City"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="city"
|
||||||
|
value={props.values.city}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.city && props.touched.city) && props.errors.city}
|
||||||
|
/>
|
||||||
|
{/* <InputCom
|
||||||
|
fieldClass="px-6"
|
||||||
|
label="State/Province"
|
||||||
|
labelClass="tracking-wide"
|
||||||
|
inputBg="bg-slate-100"
|
||||||
|
inputClass="input-curve lg border border-light-purple"
|
||||||
|
type="text"
|
||||||
|
name="state"
|
||||||
|
value={props.values.state}
|
||||||
|
inputHandler={props.handleChange}
|
||||||
|
error={(props.errors.state && props.touched.state) && props.errors.state}
|
||||||
|
/> */}
|
||||||
|
|
||||||
|
<div className="field w-full grid md:grid-cols-2 gap-4">
|
||||||
|
<div className="field w-full">
|
||||||
<label
|
<label
|
||||||
htmlFor="country"
|
htmlFor="state"
|
||||||
className="job-label job-label-flex"
|
className="job-label job-label-flex"
|
||||||
>
|
>
|
||||||
<span>Country</span>
|
<span>State/Province</span>
|
||||||
{props.errors.country && props.touched.country && (
|
{props.errors.state && props.touched.state && (
|
||||||
<span className="text-[12px] text-red-500">
|
<span className="text-[12px] text-red-500">
|
||||||
{props.errors.country}
|
{props.errors.state}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
<select
|
<select
|
||||||
id="country"
|
id="state"
|
||||||
name="country"
|
name="state"
|
||||||
value={props.values.country}
|
value={props.values.state}
|
||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
disabled={countryCode ? true : false}
|
|
||||||
>
|
>
|
||||||
{allCountries.loading ?
|
{state.loading ?
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Loading...
|
Loading...
|
||||||
</option>
|
|
||||||
: allCountries.data?.length > 0 ?
|
|
||||||
<>
|
|
||||||
<option className="text-slate-500 text-lg" value="">
|
|
||||||
Select Country
|
|
||||||
</option>
|
|
||||||
{allCountries.data?.map(item => (
|
|
||||||
<option key={item.uid} className="text-slate-500 text-lg" value={item.code}>
|
|
||||||
{item.country}
|
|
||||||
</option>
|
</option>
|
||||||
))}
|
: Object.keys(state.data)?.length > 0 ?
|
||||||
</>
|
<>
|
||||||
:
|
<option className="text-slate-500 text-lg" value="">
|
||||||
<option className="text-slate-500 text-lg" value="">
|
Select State
|
||||||
Not Found
|
</option>
|
||||||
</option>
|
{Object.keys(state.data)?.map((item, index) => (
|
||||||
}
|
<option key={index} className="text-slate-500 text-lg" value={item}>
|
||||||
|
{state?.data[item]}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<option className="text-slate-500 text-lg" value="">
|
||||||
|
Not Found
|
||||||
|
</option>
|
||||||
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className='md:col-span-2'>
|
|
||||||
<InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Phone Number"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="w-full input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="phone_number"
|
|
||||||
value={props.values.phone_number}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.phone_number && props.touched.phone_number) && props.errors.phone_number}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<InputCom
|
|
||||||
disable={true}
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Email"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="email"
|
|
||||||
value={props.values.email}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.email && props.touched.email) && props.errors.email}
|
|
||||||
/>
|
|
||||||
<div className="hidden field w-full md:grid-cols-2 gap-4">
|
|
||||||
<InputCom
|
|
||||||
disable={true}
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Firstname"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="firstname"
|
|
||||||
value={props.values.firstname}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.firstname && props.touched.firstname) && props.errors.firstname}
|
|
||||||
/>
|
|
||||||
<InputCom
|
|
||||||
disable={true}
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Lastname"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="lastname"
|
|
||||||
value={props.values.lastname}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.lastname && props.touched.lastname) && props.errors.lastname}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="field w-full flex flex-col gap-4">
|
|
||||||
<p className='hidden job-label'>Date of Birth</p>
|
|
||||||
<div className='hidden xxs:grid-cols-3 gap-4'>
|
|
||||||
<div className="field w-full">
|
|
||||||
<label
|
|
||||||
htmlFor="birthDay"
|
|
||||||
className="job-label job-label-flex"
|
|
||||||
>
|
|
||||||
<span>Day</span>
|
|
||||||
{props.errors.birthDay && props.touched.birthDay && (
|
|
||||||
<span className="text-[12px] text-red-500">
|
|
||||||
{props.errors.birthDay}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
id="birthDay"
|
|
||||||
name="birthDay"
|
|
||||||
value={props.values.birthDay}
|
|
||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
>
|
|
||||||
<>
|
|
||||||
<option className="text-slate-500 text-lg" value=''>
|
|
||||||
select
|
|
||||||
</option>
|
|
||||||
{day.map(item => (
|
|
||||||
<option key={item} className="text-slate-500 text-lg" value={item}>
|
|
||||||
{item}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div className="field w-full">
|
|
||||||
<label
|
|
||||||
htmlFor="birthMonth"
|
|
||||||
className="job-label job-label-flex"
|
|
||||||
>
|
|
||||||
<span>Month</span>
|
|
||||||
{props.errors.birthMonth && props.touched.birthMonth && (
|
|
||||||
<span className="text-[12px] text-red-500">
|
|
||||||
{props.errors.birthMonth}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
id="birthMonth"
|
|
||||||
name="birthMonth"
|
|
||||||
value={props.values.birthMonth}
|
|
||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
>
|
|
||||||
<>
|
|
||||||
<option className="text-slate-500 text-lg" value=''>
|
|
||||||
select
|
|
||||||
</option>
|
|
||||||
{month.map(item => (
|
|
||||||
<option key={item.value} className="text-slate-500 text-lg" value={item.value}>
|
|
||||||
{item.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div className="field w-full">
|
|
||||||
<label
|
|
||||||
htmlFor="birthYear"
|
|
||||||
className="job-label job-label-flex"
|
|
||||||
>
|
|
||||||
<span>Year</span>
|
|
||||||
{props.errors.birthYear && props.touched.birthYear && (
|
|
||||||
<span className="text-[12px] text-red-500">
|
|
||||||
{props.errors.birthYear}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
id="birthYear"
|
|
||||||
name="birthYear"
|
|
||||||
value={props.values.birthYear}
|
|
||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
>
|
|
||||||
<>
|
|
||||||
<option className="text-slate-500 text-lg" value=''>
|
|
||||||
select
|
|
||||||
</option>
|
|
||||||
{year.map(item => (
|
|
||||||
<option key={item} className="text-slate-500 text-lg" value={item}>
|
|
||||||
{item}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className=''>
|
|
||||||
<InputCom
|
<InputCom
|
||||||
fieldClass="px-6"
|
fieldClass="px-6"
|
||||||
label="Date of Birth"
|
label="Zip Code"
|
||||||
labelClass="tracking-wide"
|
labelClass="tracking-wide"
|
||||||
inputBg="bg-slate-100"
|
inputBg="bg-slate-100"
|
||||||
inputClass="input-curve lg border border-light-purple"
|
inputClass="input-curve lg border border-light-purple"
|
||||||
type="date"
|
type="text"
|
||||||
name="dob"
|
name="zipCode"
|
||||||
value={props.values.dob}
|
value={props.values.zipCode}
|
||||||
inputHandler={props.handleChange}
|
inputHandler={props.handleChange}
|
||||||
error={(props.errors.dob && props.touched.dob) && props.errors.dob}
|
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
|
||||||
maxDate={year[0] + '-12-31'}
|
|
||||||
minDate={year[year?.length - 1] + '-01-01'}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/* right part */}
|
<div className='p-4 w-full job-label'>
|
||||||
<div className='p-4 w-full flex flex-col gap-4 bg-blue-200 dark:bg-slate-900 rounded-2xl'>
|
<div className='flex gap-4 items-center'>
|
||||||
<InputCom
|
<input
|
||||||
fieldClass="px-6"
|
type='checkbox'
|
||||||
label="Address"
|
name="checked"
|
||||||
labelClass="tracking-wide"
|
className='accent-purple w-4 h-4 p-2 text-purple bg-gray-100 border-gray-300 rounded focus:ring-purple'
|
||||||
inputBg="bg-slate-100"
|
onChange={props.handleChange}
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="address"
|
|
||||||
value={props.values.address}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.address && props.touched.address) && props.errors.address}
|
|
||||||
/>
|
|
||||||
<InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="City"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="city"
|
|
||||||
value={props.values.city}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.city && props.touched.city) && props.errors.city}
|
|
||||||
/>
|
|
||||||
{/* <InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="State/Province"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="state"
|
|
||||||
value={props.values.state}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.state && props.touched.state) && props.errors.state}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<div className="field w-full grid md:grid-cols-2 gap-4">
|
|
||||||
<div className="field w-full">
|
|
||||||
<label
|
|
||||||
htmlFor="state"
|
|
||||||
className="job-label job-label-flex"
|
|
||||||
>
|
|
||||||
<span>State/Province</span>
|
|
||||||
{props.errors.state && props.touched.state && (
|
|
||||||
<span className="text-[12px] text-red-500">
|
|
||||||
{props.errors.state}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
id="state"
|
|
||||||
name="state"
|
|
||||||
value={props.values.state}
|
|
||||||
className={`input-field p-2 mt-3 rounded-full placeholder:text-base text-dark-gray w-full h-[42px] bg-slate-100 focus:ring-0 focus:outline-none border`}
|
|
||||||
onChange={props.handleChange}
|
|
||||||
>
|
|
||||||
{state.loading ?
|
|
||||||
<option className="text-slate-500 text-lg" value="">
|
|
||||||
Loading...
|
|
||||||
</option>
|
|
||||||
: Object.keys(state.data)?.length > 0 ?
|
|
||||||
<>
|
|
||||||
<option className="text-slate-500 text-lg" value="">
|
|
||||||
Select State
|
|
||||||
</option>
|
|
||||||
{Object.keys(state.data)?.map((item, index) => (
|
|
||||||
<option key={index} className="text-slate-500 text-lg" value={item}>
|
|
||||||
{state?.data[item]}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</>
|
|
||||||
:
|
|
||||||
<option className="text-slate-500 text-lg" value="">
|
|
||||||
Not Found
|
|
||||||
</option>
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<InputCom
|
|
||||||
fieldClass="px-6"
|
|
||||||
label="Zip Code"
|
|
||||||
labelClass="tracking-wide"
|
|
||||||
inputBg="bg-slate-100"
|
|
||||||
inputClass="input-curve lg border border-light-purple"
|
|
||||||
type="text"
|
|
||||||
name="zipCode"
|
|
||||||
value={props.values.zipCode}
|
|
||||||
inputHandler={props.handleChange}
|
|
||||||
error={(props.errors.zipCode && props.touched.zipCode) && props.errors.zipCode}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
<p className='text-[14px] text-justify'>
|
||||||
|
I agree with the <span className='text-bue-600'>cardholder </span>
|
||||||
|
terms & conditions {props.errors.checked && props.touched.checked && <span className='text-[12px] text-red-500'>{props.errors.checked}</span>}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{requestStatus.message &&
|
{requestStatus.message &&
|
||||||
@@ -556,8 +583,8 @@ const VirtualAddCardPopout = ({ details, onClose, situation, walletItem }) => {
|
|||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Form>
|
||||||
</Form>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
</ModalCom>
|
</ModalCom>
|
||||||
|
|||||||
@@ -399,7 +399,8 @@ export default function ManageInterestOffer(props) {
|
|||||||
<div className='mb-4 border-b-2 flex flex-col xxs:flex-row md:flex-col justify-center items-center gap-4'>
|
<div className='mb-4 border-b-2 flex flex-col xxs:flex-row md:flex-col justify-center items-center gap-4'>
|
||||||
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Wallet:</p>
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Wallet:</p>
|
||||||
<span className="font-medium text-dark-gray dark:text-white">{ walletDetails?.loading ? 'loading...' : PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span>
|
{/* <span className="font-medium text-dark-gray dark:text-white">{ walletDetails?.loading ? 'loading...' : PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency)}</span> */}
|
||||||
|
<span className="font-medium text-dark-gray dark:text-white">{ walletBal.length > 0 ? PriceFormatter(walletBal[0]?.amount * 0.01,props?.offerDetails?.currency_code,props?.offerDetails?.currency) : 'loading...'}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
<div className='w-full flex flex-col lg:flex-row justify-center items-center gap-2'>
|
||||||
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Reward:</p>
|
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">Reward:</p>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
import {useLocation} from 'react-router-dom'
|
||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
function Default({ children }) {
|
function Default({ children }) {
|
||||||
|
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);
|
||||||
|
|
||||||
@@ -13,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(
|
||||||
@@ -55,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)
|
||||||
@@ -72,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>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Sidebar from "./Sidebar";
|
|||||||
|
|
||||||
export default function Layout({ children }) {
|
export default function Layout({ children }) {
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails); // CHECKS FOR USER Details
|
const { userDetails } = useSelector((state) => state?.userDetails); // CHECKS FOR USER Details
|
||||||
|
|
||||||
const { drawer } = useSelector((state) => state.drawer);
|
const { drawer } = useSelector((state) => state.drawer);
|
||||||
const { userJobList } = useSelector((state) => state.userJobList);
|
const { userJobList } = useSelector((state) => state.userJobList);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -22,13 +22,14 @@ export default function Layout({ children }) {
|
|||||||
};
|
};
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const logOut = () => {
|
const logOut = () => {
|
||||||
|
let loginType = userDetails?.account_type == 'FULL' ? 'parent' : 'kid'
|
||||||
sessionStorage.clear();
|
sessionStorage.clear();
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
// toast.success("Come Back Soon", {
|
// toast.success("Come Back Soon", {
|
||||||
// icon: `🙂`,
|
// icon: `🙂`,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
navigate("/login", { replace: true });
|
navigate(`/login/${loginType}`, {state:{loginType:userDetails?.account_type.toLowerCase()}, replace:true});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -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" />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -24,17 +24,19 @@ export default function Resources(props) {
|
|||||||
const ownProducts = products.datas;
|
const ownProducts = products.datas;
|
||||||
// Resource Props
|
// Resource Props
|
||||||
const __resources = props.MyResourceData;
|
const __resources = props.MyResourceData;
|
||||||
|
|
||||||
//debugger;
|
//debugger;
|
||||||
// Collection Items
|
// Collection Items
|
||||||
const CreatedSell = __resources?.marketdata?.data;
|
const CreatedSell = __resources?.marketdata?.data;
|
||||||
const tab_categories = __resources?.tab_categories?.data;
|
// const tab_categories = __resources?.tab_categories?.data?.sort((a, b) => b.name.localeCompare(a.name)) // SORT REMOVED
|
||||||
|
const tab_categories = __resources?.tab_categories?.data
|
||||||
const collectionProducts = __resources?.collectiondata?.data;
|
const collectionProducts = __resources?.collectiondata?.data;
|
||||||
const onSaleProducts = __resources?.marketdata?.data;
|
const onSaleProducts = __resources?.marketdata?.data;
|
||||||
const CreatedBits = __resources?.productdata?.datas;
|
const CreatedBits = __resources?.productdata?.datas;
|
||||||
const blogItems = __resources?.blogdata?.payload;
|
const blogItems = __resources?.blogdata?.payload;
|
||||||
|
|
||||||
console.log(__resources);
|
// console.log(__resources);
|
||||||
console.log("Blog data >> ", blogItems);
|
// console.log("Blog data >> ", blogItems);
|
||||||
|
|
||||||
// My Items Data
|
// My Items Data
|
||||||
const [uploadedFiles, setUploadedFiles] = useState({
|
const [uploadedFiles, setUploadedFiles] = useState({
|
||||||
@@ -77,23 +79,22 @@ export default function Resources(props) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
getUploadedFiles();
|
|
||||||
}, [uploadsTable]);
|
|
||||||
|
|
||||||
// const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
|
// const [tab, setTab] = useState(tab_categories ? tab_categories[0]?.name : "");
|
||||||
const [tab, setTab] = useState(
|
const [tab, setTab] = useState(
|
||||||
props.activeTab
|
props.activeTab
|
||||||
? props.activeTab
|
? props.activeTab
|
||||||
: tab_categories
|
: "onsale"
|
||||||
? tab_categories[0]?.name
|
|
||||||
: ""
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getUploadedFiles();
|
||||||
|
}, [uploadsTable]);
|
||||||
|
|
||||||
|
|
||||||
// Category Components
|
// Category Components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
blog: <BlogTab blogdata={blogItems} />,
|
blog: <BlogTab blogdata={blogItems} />,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default function QuestionsTab({ className, products }) {
|
|||||||
question: ''
|
question: ''
|
||||||
}
|
}
|
||||||
apiCall.askResourcesResult().then(res => {
|
apiCall.askResourcesResult().then(res => {
|
||||||
console.log(res.data.choices[0].text)
|
// console.log(res.data.choices[0].text)
|
||||||
if(!res.data || res.data?.choices?.length < 1){
|
if(!res.data || res.data?.choices?.length < 1){
|
||||||
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default function FamAIQuestion() {
|
|||||||
question: ''
|
question: ''
|
||||||
}
|
}
|
||||||
apiCall.askResourcesResult().then(res => {
|
apiCall.askResourcesResult().then(res => {
|
||||||
console.log(res.data.choices[0].text)
|
// console.log(res.data.choices[0].text)
|
||||||
if(!res.data || res.data?.choices?.length < 1){
|
if(!res.data || res.data?.choices?.length < 1){
|
||||||
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
setRequestStatus({loading: false, status: false, message: 'No result found!'})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { useReactToPrint } from 'react-to-print'
|
|||||||
|
|
||||||
const Iframe = lazy(() => import("../Iframe/Iframe"));
|
const Iframe = lazy(() => import("../Iframe/Iframe"));
|
||||||
|
|
||||||
export default function FamGames() {
|
export default function FamGames(props) {
|
||||||
|
|
||||||
const ApiCall = new usersService();
|
const ApiCall = new usersService();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -40,7 +40,7 @@ export default function FamGames() {
|
|||||||
|
|
||||||
// FUNCTION TO HANDLE POPOUT
|
// FUNCTION TO HANDLE POPOUT
|
||||||
const popUpHandler = () => {
|
const popUpHandler = () => {
|
||||||
setPopUp((prev) => !prev);
|
// setPopUp((prev) => !prev);
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION TO HANDLE MESSAGE CHANGE
|
// FUNCTION TO HANDLE MESSAGE CHANGE
|
||||||
@@ -136,7 +136,7 @@ export default function FamGames() {
|
|||||||
message: "Message Sent Successfully",
|
message: "Message Sent Successfully",
|
||||||
});
|
});
|
||||||
// function to trigger socket to emit 'send_message'
|
// function to trigger socket to emit 'send_message'
|
||||||
sendMessage(messageToSend, `${props.details.contract}-${props.details.contract_uid}`)
|
// sendMessage(messageToSend, `${props.details.contract}-${props.details.contract_uid}`)
|
||||||
|
|
||||||
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
props.reloadActiveJobList((prev) => !prev); // MAKES ACTIVE JOB MESSAGE LIST TO RELOAD
|
||||||
setMessageToSend(""); // SENDS MESSAGE TO SEND BACK TO EMPTY STRINGS
|
setMessageToSend(""); // SENDS MESSAGE TO SEND BACK TO EMPTY STRINGS
|
||||||
@@ -176,12 +176,12 @@ export default function FamGames() {
|
|||||||
|
|
||||||
const fileToBase64 = async () => {
|
const fileToBase64 = async () => {
|
||||||
// Converts file data to base64 string
|
// Converts file data to base64 string
|
||||||
try {
|
// try {
|
||||||
const base64String = await convertFileToBase64(filesToSend[i]);
|
// const base64String = await convertFileToBase64(filesToSend[i]);
|
||||||
return base64String;
|
// return base64String;
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
// if(await !fileToBase64()){
|
// if(await !fileToBase64()){
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
|
|||||||
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
import LoadingSpinner from '../Spinners/LoadingSpinner'
|
||||||
|
|
||||||
export default function InfiniteScroll({
|
export default function InfiniteScroll({
|
||||||
allData=data,
|
allData=[],
|
||||||
addItemBy=12,
|
addItemBy=12,
|
||||||
intialItemsToShow=39,
|
intialItemsToShow=39,
|
||||||
children
|
children
|
||||||
|
|||||||
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
import React from "react";
|
import React ,{Suspense} from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import { BrowserRouter } from "react-router-dom";
|
import { BrowserRouter } from "react-router-dom";
|
||||||
@@ -13,7 +13,9 @@ ReactDOM.createRoot(root).render(
|
|||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<GoogleOAuthProvider clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}>
|
<GoogleOAuthProvider clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}>
|
||||||
<App />
|
<Suspense>
|
||||||
|
<App />
|
||||||
|
</Suspense>
|
||||||
</GoogleOAuthProvider>
|
</GoogleOAuthProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ export const apiConst = {
|
|||||||
|
|
||||||
WRENCHBOARD_COUNTRY_STATE: 649,
|
WRENCHBOARD_COUNTRY_STATE: 649,
|
||||||
WRENCHBOARD_WALLET_CARD_REQUEST: 11080,
|
WRENCHBOARD_WALLET_CARD_REQUEST: 11080,
|
||||||
|
WRENCHBOARD_WALLET_CARD_FAMILY_REQUEST: 11082,
|
||||||
|
|
||||||
WRENCHBOARD_SEND_CONTACTUS: 11030,
|
WRENCHBOARD_SEND_CONTACTUS: 11030,
|
||||||
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
|
WRENCHBOARD_ACCOUNT_SENDREFER: 11032,
|
||||||
|
|||||||
@@ -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(() => {
|
||||||
@@ -93,13 +90,13 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
apiCall
|
apiCall
|
||||||
.loadProfile()
|
.loadProfile()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.internal_return < 0) {
|
if (res?.data?.internal_return < 0) {
|
||||||
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]);
|
||||||
|
|
||||||
@@ -136,12 +135,10 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
apiCall
|
apiCall
|
||||||
.getMyNotifications()
|
.getMyNotifications()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.internal_return < 0) {
|
if (res?.data?.internal_return < 0) {
|
||||||
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 () => {
|
||||||
@@ -201,38 +198,41 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
const res = await apiCall.getMyJobList();
|
const res = await apiCall.getMyJobList();
|
||||||
// setMyJobList({loading: false, data:res.data})
|
// setMyJobList({loading: false, data:res.data})
|
||||||
// setMyJobList(res.data);
|
// setMyJobList(res.data);
|
||||||
dispatch(updateUserJobList({ loading: false, data: res.data }));
|
dispatch(updateUserJobList({ loading: false, data: res?.data }));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(updateUserJobList({ loading: false, data: [] }));
|
dispatch(updateUserJobList({ loading: false, data: [] }));
|
||||||
// setMyJobList({loading: false, data:[]})
|
// setMyJobList({loading: false, data:[]})
|
||||||
console.log("Error getting mode");
|
// console.log("Error getting mode");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getMyJobList();
|
getMyJobList();
|
||||||
}, [jobListTable, isLogin.status]);
|
}, [jobListTable, isLogin.status]);
|
||||||
|
|
||||||
|
//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 () => {
|
||||||
dispatch(updateWalletDetails({ loading: true, data: [] }));
|
dispatch(updateWalletDetails({ loading: true, data: [] }));
|
||||||
try {
|
try {
|
||||||
const res = await apiCall.getUserWallets();
|
const res = await apiCall.getUserWallets();
|
||||||
console.log("wallet - >", res.data);
|
// console.log("wallet - >", res.data);
|
||||||
dispatch(
|
dispatch(
|
||||||
updateWalletDetails({ loading: false, data: res.data?.result_list })
|
updateWalletDetails({ loading: false, data: res?.data?.result_list })
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(updateWalletDetails({ loading: false, data: [] }));
|
dispatch(updateWalletDetails({ loading: false, data: [] }));
|
||||||
console.log("Error getting mode");
|
// console.log("Error getting mode");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getMyWalletList();
|
getMyWalletList();
|
||||||
}, [walletTable, isLogin.status]);
|
}, [walletTable, isLogin.status]);
|
||||||
|
|
||||||
|
|
||||||
|
// 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
|
||||||
@@ -243,7 +243,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
dispatch(updateJobs({loading: false, ...res.data}));
|
dispatch(updateJobs({loading: false, ...res.data}));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(updateJobs({loading: false}));
|
dispatch(updateJobs({loading: false}));
|
||||||
console.log("Error getting mode");
|
// console.log("Error getting mode");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getMarketActiveJobList();
|
getMarketActiveJobList();
|
||||||
@@ -251,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
|
||||||
@@ -271,17 +271,20 @@ 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}))
|
||||||
console.log("Error getting tasks");
|
// console.log("Error getting tasks");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getFamilyBanners()
|
getFamilyBanners()
|
||||||
@@ -289,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
|
||||||
@@ -298,7 +301,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
dispatch(familyResources(res?.data?.result_list))
|
dispatch(familyResources(res?.data?.result_list))
|
||||||
// console.log('RESPONSE', res?.data?.result_list)
|
// console.log('RESPONSE', res?.data?.result_list)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error getting tasks");
|
// console.log("Error getting tasks");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getFamilyResourcesList()
|
getFamilyResourcesList()
|
||||||
@@ -307,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
|
||||||
@@ -315,7 +318,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
apiCall.getFamilyWalletRedeemOptions().then((res)=>{
|
apiCall.getFamilyWalletRedeemOptions().then((res)=>{
|
||||||
dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list}))
|
dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list}))
|
||||||
}).catch((err)=>{
|
}).catch((err)=>{
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
dispatch(familyWalletRedeemOptList({loading: false, image: '', data:{}}))
|
dispatch(familyWalletRedeemOptList({loading: false, image: '', data:{}}))
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@@ -329,7 +332,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update for parent child job assign
|
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update for parent child job assign
|
||||||
if(loggedIn || isLogin.status){
|
if(loggedIn || isLogin.status){
|
||||||
joinRoom(`FAMILY-${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}`)
|
joinRoom(`FAMILY-${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}`)
|
||||||
console.log(`Room joined for parent child task assign as ${account_type} with ${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}}`)
|
// console.log(`Room joined for parent child task assign as ${account_type} with ${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}}`)
|
||||||
}
|
}
|
||||||
},[isLogin.status])
|
},[isLogin.status])
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import SocketIOContextProvider from '../components/Contexts/SocketIOContext'
|
||||||
|
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
export default function SocketConnection() {
|
||||||
|
return (
|
||||||
|
<SocketIOContextProvider>
|
||||||
|
<Outlet />
|
||||||
|
</SocketIOContextProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ import { apiConst } from "../lib/apiConst";
|
|||||||
|
|
||||||
class usersService {
|
class usersService {
|
||||||
constructor() {
|
constructor() {
|
||||||
console.log("WRB Service Entry");
|
// console.log("WRB Service Entry");
|
||||||
}
|
}
|
||||||
|
|
||||||
MyPageIntro(reqData) {
|
MyPageIntro(reqData) {
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -1548,7 +1549,7 @@ class usersService {
|
|||||||
return this.postAuxEnd("/countrystate", postData);
|
return this.postAuxEnd("/countrystate", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
//API TO GET STATES FROM COUNTRY
|
//API TO REQUEST FOR VIRTUAL CARD
|
||||||
walletCardRequest(reqData){
|
walletCardRequest(reqData){
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
@@ -1561,6 +1562,18 @@ class usersService {
|
|||||||
return this.postAuxEnd("/wallets/card/request", postData);
|
return this.postAuxEnd("/wallets/card/request", postData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//API TO REQUEST FOR FAMILY VIRTUAL CARD
|
||||||
|
walletCardFamilyRequest(reqData){
|
||||||
|
var postData = {
|
||||||
|
uid: localStorage.getItem("uid"),
|
||||||
|
member_id: localStorage.getItem("member_id"),
|
||||||
|
sessionid: localStorage.getItem("session_token"),
|
||||||
|
action: apiConst.WRENCHBOARD_WALLET_CARD_FAMILY_REQUEST,
|
||||||
|
...reqData
|
||||||
|
};
|
||||||
|
return this.postAuxEnd("/wallets/card/familyrequest", postData);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(username)
|
||||||
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
- 20:27:30.118 FLOG_MAX [757411]: REQ_STRING(password)
|
||||||
@@ -1632,19 +1645,22 @@ class usersService {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
// console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
||||||
return response;
|
return response;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
//response status is an error code
|
//response status is an error code
|
||||||
console.log(error.response.status);
|
// console.log(error.response.status);
|
||||||
|
return
|
||||||
} else if (error.request) {
|
} else if (error.request) {
|
||||||
//response not received though the request was sent
|
//response not received though the request was sent
|
||||||
console.log(error.request);
|
// console.log(error.request);
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
//an error occurred when setting up the request
|
//an error occurred when setting up the request
|
||||||
console.log(error.message);
|
// console.log(error.message);
|
||||||
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1673,8 +1689,8 @@ class usersService {
|
|||||||
}
|
}
|
||||||
return Axios.post(endPoint, reqData)
|
return Axios.post(endPoint, reqData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log(response);
|
// console.log(response);
|
||||||
console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~");
|
// console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~");
|
||||||
if (response.data.internal_return == "-9999") {
|
if (response.data.internal_return == "-9999") {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
window.location.href = `/login?sessionExpired=true`;
|
window.location.href = `/login?sessionExpired=true`;
|
||||||
@@ -1684,31 +1700,34 @@ class usersService {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
//response status is an error code
|
//response status is an error code
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR-------------------------------------------------------"
|
// "ERROR-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error.response.status);
|
// console.log(error.response.status);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR-------------------------------------------------------"
|
// "ERROR-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
} else if (error.request) {
|
} else if (error.request) {
|
||||||
//response not received though the request was sent
|
//response not received though the request was sent
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR2-------------------------------------------------------"
|
// "ERROR2-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error?.request);
|
// console.log(error?.request);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR2-------------------------------------------------------"
|
// "ERROR2-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
//an error occurred when setting up the request
|
//an error occurred when setting up the request
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR3-------------------------------------------------------"
|
// "ERROR3-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR3-------------------------------------------------------"
|
// "ERROR3-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1739,9 +1758,9 @@ class usersService {
|
|||||||
// Axios.defaults.headers['X-API-KEY'] = endPointKey;
|
// Axios.defaults.headers['X-API-KEY'] = endPointKey;
|
||||||
return Axios.post(endPoint, reqData)
|
return Axios.post(endPoint, reqData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log(response);
|
// console.log(response);
|
||||||
// res = response;
|
// res = response;
|
||||||
console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
|
// console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
|
||||||
if (response.data.internal_return == "-9999") {
|
if (response.data.internal_return == "-9999") {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
window.location.href = `/login?sessionExpired=true`;
|
window.location.href = `/login?sessionExpired=true`;
|
||||||
@@ -1751,31 +1770,34 @@ class usersService {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
//response status is an error code
|
//response status is an error code
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR-------------------------------------------------------"
|
// "ERROR-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error.response.status);
|
// console.log(error.response.status);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR-------------------------------------------------------"
|
// "ERROR-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
} else if (error.request) {
|
} else if (error.request) {
|
||||||
//response not received though the request was sent
|
//response not received though the request was sent
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR2-------------------------------------------------------"
|
// "ERROR2-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error?.request);
|
// console.log(error?.request);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR2-------------------------------------------------------"
|
// "ERROR2-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
//an error occurred when setting up the request
|
//an error occurred when setting up the request
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR3-------------------------------------------------------"
|
// "ERROR3-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
console.log(error);
|
// console.log(error);
|
||||||
console.log(
|
// console.log(
|
||||||
"ERROR3-------------------------------------------------------"
|
// "ERROR3-------------------------------------------------------"
|
||||||
);
|
// );
|
||||||
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import React from "react";
|
||||||
|
import LoginLanding from "../components/AuthPages/Login/LoginLanding";
|
||||||
|
|
||||||
|
function LoginLandingPage() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<LoginLanding />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoginLandingPage;
|
||||||
@@ -12,7 +12,7 @@ export default function MyPastDueTasksPage() {
|
|||||||
const getMyJobList = async () => {
|
const getMyJobList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await api.getMyPastDueJobList();
|
const res = await api.getMyPastDueJobList();
|
||||||
console.log("DATA", res.data);
|
// console.log("DATA", res.data);
|
||||||
setMyJobList({loading:false, data:res.data})
|
setMyJobList({loading:false, data:res.data})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setMyJobList({loading:false, data:[]})
|
setMyJobList({loading:false, data:[]})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import MyTasks from "../components/MyTasks";
|
import MyTasks from "../components/MyTasks";
|
||||||
|
import {useLocation} from 'react-router-dom'
|
||||||
// import UsersService from "../services/UsersService";
|
// import UsersService from "../services/UsersService";
|
||||||
import usersService from "../services/UsersService";
|
import usersService from "../services/UsersService";
|
||||||
|
|
||||||
@@ -7,6 +8,8 @@ import { useSelector } from "react-redux";
|
|||||||
import RecentlyPastDue from "../components/MyTasks/RecentlyPastDue";
|
import RecentlyPastDue from "../components/MyTasks/RecentlyPastDue";
|
||||||
|
|
||||||
export default function MyTaskPage() {
|
export default function MyTaskPage() {
|
||||||
|
const location = useLocation()
|
||||||
|
|
||||||
const api = new usersService();
|
const api = new usersService();
|
||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const tab = queryParams.get("tab")?.toLowerCase();
|
const tab = queryParams.get("tab")?.toLowerCase();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default function MyWalletPage() {
|
|||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
let walletExist = wallet_available_status || localStorage.getItem('wallet_available_status')
|
let walletExist = wallet_available_status || localStorage.getItem('wallet_available_status')
|
||||||
console.log(walletExist)
|
// console.log(walletExist)
|
||||||
if(account_type == 'FULL' && walletExist != 'WALLET_AVAILABLE'){
|
if(account_type == 'FULL' && walletExist != 'WALLET_AVAILABLE'){
|
||||||
navigate('/', {replace: true})
|
navigate('/', {replace: true})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useContext, useState, useEffect } from "react";
|
import React, { useMemo, useState, useEffect } from "react";
|
||||||
// import BlogItem from "../components/Blogs";
|
// import BlogItem from "../components/Blogs";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import OffersInterest from "../components/OffersInterest";
|
import OffersInterest from "../components/OffersInterest";
|
||||||
@@ -15,7 +15,7 @@ export default function OffersInterestPage() {
|
|||||||
|
|
||||||
let {joinRoom} = SocketValues() // function to join room for socket
|
let {joinRoom} = SocketValues() // function to join room for socket
|
||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = useMemo(()=> new usersService(),[])
|
||||||
|
|
||||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ export default function OffersInterestPage() {
|
|||||||
setOfferInterestList({loading: false, data: [], imgServer:''})
|
setOfferInterestList({loading: false, data: [], imgServer:''})
|
||||||
console.log('Error: ', err)
|
console.log('Error: ', err)
|
||||||
})
|
})
|
||||||
},[offerInterestListReload])
|
},[apiCall, offerInterestListReload])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
joinRoom(`INTEREST-${userDetails?.uid}`)
|
joinRoom(`INTEREST-${userDetails?.uid}`)
|
||||||
},[])
|
},[joinRoom, userDetails])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
+12
-12
@@ -1,22 +1,22 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useCallback, useMemo, useState, useEffect } from "react";
|
||||||
import Resources from "../components/Resources";
|
import Resources from "../components/Resources";
|
||||||
import usersService from "../services/UsersService";
|
import usersService from "../services/UsersService";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
export default function ResourcePage() {
|
export default function ResourcePage() {
|
||||||
const {state, pathname} = useLocation() // CHECKS IF THERE IS AN ACTIVE TAB WITH LINK BACK TO RESOURCES
|
const {state} = useLocation() // CHECKS IF THERE IS AN ACTIVE TAB WITH LINK BACK TO RESOURCES
|
||||||
const [MyResourceData, setMyResourceData] = useState([]);
|
const [MyResourceData, setMyResourceData] = useState([]);
|
||||||
const api = new usersService();
|
const api = useMemo(()=> new usersService(),[]);
|
||||||
const getMyResourceData = async () => {
|
const getMyResourceData = useCallback( async () => {
|
||||||
try {
|
try {
|
||||||
const res = await api.getResourceList();
|
const res = await api.getResourceList();
|
||||||
setMyResourceData(res.data);
|
setMyResourceData(res.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error("Error getting mode");
|
throw new Error("Error getting mode");
|
||||||
}
|
}
|
||||||
};
|
},[api])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getMyResourceData();
|
getMyResourceData();
|
||||||
}, []);
|
}, [getMyResourceData]);
|
||||||
|
|
||||||
return <Resources MyResourceData={MyResourceData} activeTab={state ? state.tab : ''} />;
|
return <Resources MyResourceData={MyResourceData} activeTab={state ? state.tab : ''} />;
|
||||||
}
|
}
|
||||||
@@ -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