Compare commits
203 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a51143cfdf | |||
| 7bf28617ca | |||
| f1285c54d6 | |||
| 870709c947 | |||
| ca5a036e80 | |||
| fe1ab675a4 | |||
| 40614427f1 | |||
| 7eddfdf973 | |||
| feca311e7f | |||
| bd8f25b9e8 | |||
| b26c0a238e | |||
| 8841e36136 | |||
| 7f534556be | |||
| 2bf8b2fe06 | |||
| 4718b7962e | |||
| 9cbf797ab0 | |||
| 4b132b0499 | |||
| a3320724de | |||
| ab8320a846 | |||
| 4fc109926c | |||
| e3399d4b95 | |||
| 4a732ab1e3 | |||
| 0b598e88ba | |||
| 29ce4dd933 | |||
| 17c8573031 | |||
| 368148ef61 | |||
| 3cdea696e8 | |||
| 0c96441f84 | |||
| dff610b749 | |||
| d234bb6747 | |||
| d6b6e34132 | |||
| a0f0a6cf07 | |||
| b3ae0c42c3 | |||
| 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 | |||
| ef784dc6ed | |||
| 682745c321 | |||
| c63fbfc147 | |||
| 9b0f847bc1 | |||
| c073be1ce6 | |||
| f43e10a75f | |||
| eb41751628 | |||
| fa7a0bd1da | |||
| 52ff30581f | |||
| 858bd7c0f7 | |||
| b995c36a8e | |||
| 2363bc3fd7 | |||
| ca375c4bae | |||
| 3e6e3d3910 | |||
| 747abfc47b | |||
| 520e74308d | |||
| 36c7fdd30d | |||
| 85269b9e56 | |||
| 95a918e01d | |||
| 3267414454 | |||
| 85607d81b8 | |||
| 5a1ea91b77 | |||
| 40b5e92047 | |||
| bc867ee8aa | |||
| 7c430d03bd | |||
| 9125990d70 | |||
| e64728e127 | |||
| d82b454caf | |||
| db423a3f1e | |||
| 4376938217 | |||
| 0411ab82f0 | |||
| c7d5d5533c | |||
| 3f7c673087 | |||
| da389c937e | |||
| c71d901556 | |||
| 804f76100a | |||
| 64f6e55fb6 | |||
| 16119dc332 | |||
| ae08f392ca | |||
| b646f020a5 | |||
| 31b411dcab | |||
| 48d66d263e | |||
| 2a6900f6a9 | |||
| 8b3e1e8923 | |||
| c87657eaef | |||
| 9cccd72512 | |||
| 146e8b383e | |||
| 7bb78772f7 | |||
| 094ba4fde8 | |||
| d31005c1ce | |||
| 3992ab696c | |||
| f1ed5f3a95 | |||
| 65b4c59129 | |||
| d620728651 | |||
| 4499f2d356 | |||
| fa00555a6f | |||
| 00fcb275f1 | |||
| c987ba63ff | |||
| 89797cdb3f | |||
| c719c15b2b | |||
| f3b1c229ea | |||
| 0335edf1dc | |||
| f7db65d527 | |||
| 27dc4090fb | |||
| 7f631190dc | |||
| 6815eea66c | |||
| c8e2ae9efb | |||
| 455248f9db | |||
| fee3376a88 | |||
| 956abc8411 | |||
| 64f3625990 | |||
| 9ec8855ed6 | |||
| 06450808ed | |||
| 7eecd34a5e | |||
| ab3693fc0b | |||
| e1879222b3 | |||
| 22250da988 | |||
| 7e8704d633 | |||
| 99d9a468f6 | |||
| 2ca1c668f5 | |||
| 0bb9528690 | |||
| 78a9c4bf5f | |||
| 8be4ee52f1 |
@@ -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"
|
||||||
@@ -17,12 +18,12 @@ REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api
|
|||||||
REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024"
|
REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024"
|
||||||
|
|
||||||
#SOCKETS ENDS
|
#SOCKETS ENDS
|
||||||
REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
REACT_APP_PRIMARY_SOCKET="https://socket-qa.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
|
||||||
@@ -119,7 +120,7 @@ REACT_APP_SHOW_ACCOUNT_DASH=1
|
|||||||
REACT_APP_SHOW_SLIDER_BANNERS=0
|
REACT_APP_SHOW_SLIDER_BANNERS=0
|
||||||
|
|
||||||
# FOR MEDIA LINK
|
# FOR MEDIA LINK
|
||||||
REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
|
REACT_APP_MEDIA_LINK='https://qa-media.wrenchboard.com'
|
||||||
|
|
||||||
# FOR FAMILY GAME LINK
|
# FOR FAMILY GAME LINK
|
||||||
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
||||||
@@ -129,3 +130,9 @@ REACT_APP_CUSTOMTIMER=90
|
|||||||
|
|
||||||
#SHOW OR HIDE MY PAGE LINK ROUTE
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
REACT_APP_SHOW_USER_PAGE=1
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://dev-www.wrenchboard.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://dev-www.wrenchboard.com/about-us'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://dev-www.wrenchboard.com/contact'
|
||||||
|
REACT_APP_TERMS_LINK='https://dev-www.wrenchboard.com/terms'
|
||||||
+10
-3
@@ -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"
|
||||||
@@ -17,12 +18,12 @@ REACT_APP_USERS_ENDPOINT="https://apigate.lotus.g1.wrenchboard.com/en/wrench/api
|
|||||||
REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024"
|
REACT_APP_ENDPOINT_KEY="WRENCH-BOARD-2024"
|
||||||
|
|
||||||
#SOCKETS ENDS
|
#SOCKETS ENDS
|
||||||
REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
REACT_APP_PRIMARY_SOCKET="https://socket-qa.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
|
||||||
@@ -88,7 +89,7 @@ REACT_APP_SHOW_ACCOUNT_DASH=1
|
|||||||
REACT_APP_SHOW_SLIDER_BANNERS=0
|
REACT_APP_SHOW_SLIDER_BANNERS=0
|
||||||
|
|
||||||
# FOR MEDIA LINK
|
# FOR MEDIA LINK
|
||||||
REACT_APP_MEDIA_LINK='https://dev-media.wrenchboard.com'
|
REACT_APP_MEDIA_LINK='https://qa-media.wrenchboard.com'
|
||||||
|
|
||||||
# FOR FAMILY GAME LINK
|
# FOR FAMILY GAME LINK
|
||||||
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
REACT_APP_FAM_GAME_LINK='https://games.wrenchboard.com'
|
||||||
@@ -98,3 +99,9 @@ REACT_APP_CUSTOMTIMER=90
|
|||||||
|
|
||||||
#SHOW OR HIDE MY PAGE LINK ROUTE
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
REACT_APP_SHOW_USER_PAGE=1
|
REACT_APP_SHOW_USER_PAGE=1
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://dev-www.wrenchboard.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://dev-www.wrenchboard.com/about-us'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://dev-www.wrenchboard.com/contact'
|
||||||
|
REACT_APP_TERMS_LINK='https://dev-www.wrenchboard.com/terms'
|
||||||
+8
-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
|
||||||
@@ -104,3 +105,9 @@ REACT_APP_CUSTOMTIMER=90
|
|||||||
|
|
||||||
#SHOW OR HIDE MY PAGE LINK ROUTE
|
#SHOW OR HIDE MY PAGE LINK ROUTE
|
||||||
REACT_APP_SHOW_USER_PAGE=0
|
REACT_APP_SHOW_USER_PAGE=0
|
||||||
|
|
||||||
|
# login footer links
|
||||||
|
REACT_APP_HOME_LINK='https://www.wrenchboard.com/'
|
||||||
|
REACT_APP_ABOUT_LINK='https://www.wrenchboard.com/about-us'
|
||||||
|
REACT_APP_CONTACTS_LINK='https://www.wrenchboard.com/contact'
|
||||||
|
REACT_APP_TERMS_LINK='https://www.wrenchboard.com/terms'
|
||||||
+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
@@ -25,8 +25,9 @@ services:
|
|||||||
- apigate.orion.g1.wrenchboard.com:10.10.33.15
|
- apigate.orion.g1.wrenchboard.com:10.10.33.15
|
||||||
- socket-dev.wrenchboard.com:10.10.33.15
|
- socket-dev.wrenchboard.com:10.10.33.15
|
||||||
- socket.wrenchboard.com:10.10.33.15
|
- socket.wrenchboard.com:10.10.33.15
|
||||||
- apigateway.wrenchboard.app.dev.fluxtra.net:10.20.30.19
|
- media.wrenchboard.com:10.10.33.15
|
||||||
- apigateway.wrenchboard.app.lotus.fluxtra.net:172.31.4.19
|
- www.wrenchboard.com:10.10.33.15
|
||||||
|
- blog.wrenchboard.com:10.10.33.15
|
||||||
environment:
|
environment:
|
||||||
- CHOKIDAR_USEPOLLING=true
|
- CHOKIDAR_USEPOLLING=true
|
||||||
- NODE_ENV=${NODE_ENV:-production}
|
- NODE_ENV=${NODE_ENV:-production}
|
||||||
|
|||||||
+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
-3
@@ -19,9 +19,7 @@
|
|||||||
content="Empower families to reward accomplishment, set goals, and encourage kids to understand goals, earning, and the benefit of savings – in one app experience."
|
content="Empower families to reward accomplishment, set goals, and encourage kids to understand goals, earning, and the benefit of savings – in one app experience."
|
||||||
/>
|
/>
|
||||||
<link rel="manifest" href="/manifest.json"/>
|
<link rel="manifest" href="/manifest.json"/>
|
||||||
<script>
|
|
||||||
!function(e,a,t,n,g,c,o){e.GoogleAnalyticsObject=g,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,c=a.createElement(t),o=a.getElementsByTagName(t)[0],c.async=1,c.src="https://www.google-analytics.com/analytics.js",o.parentNode.insertBefore(c,o)}(window,document,"script",0,"ga"),ga("create","UA-54829827-4","auto"),ga("send","pageview")</script><script defer="defer" src="/static/js/main.787e423f.js"></script><link href="/static/css/main.418eaf65.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body><script>var LHC_API=LHC_API||{};LHC_API.args={mode:"widget",lhc_base_url:"//chat.live.wrenchboard.com/",wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:!0,check_messages:!1},function(){var e=document.createElement("script");e.type="text/javascript",e.setAttribute("crossorigin","anonymous"),e.async=!0;var t=new Date;e.src="//chat.live.wrenchboard.com/design/defaulttheme/js/widgetv2/index.js?"+t.getFullYear()+t.getMonth()+t.getDate();var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
|
|||||||
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+137
-144
@@ -1,83 +1,90 @@
|
|||||||
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 SocketConnection from "./middleware/SocketConnection";
|
||||||
import Notification from "./components/Notification";
|
|
||||||
import AuthRoute from "./middleware/AuthRoute";
|
// AUTH PAGES
|
||||||
import AppDownloadPage from "./views/AppDownloadPage";
|
import LoginLandingPage from './views/LoginLandingPage';
|
||||||
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 LoginPageTwo from "./views/LoginPageTwo";
|
||||||
import ManageActiveJobs from "./views/ManageActiveJobs";
|
import FourZeroFour from "./components/FourZeroFour";
|
||||||
import ManageInterestOfferPage from "./views/ManageInterestOfferPage";
|
import AppDownloadPage from "./views/AppDownloadPage";
|
||||||
import MarketPlacePage from "./views/MarketPlacePage";
|
import AppleRedirectPage from "./views/AppleRedirectPage";
|
||||||
import MyActiveJobsPage from "./views/MyActiveJobsPage";
|
import AuthRedirect from "./views/AuthRedirect";
|
||||||
import MyCouponPage from "./views/MyCouponPage";
|
import ForgotPasswordPages from "./views/ForgotPasswordPages";
|
||||||
import MyJobsPage from "./views/MyJobsPage";
|
import ForgotPasswordPagesTwo from "./views/ForgotPasswordPagesTwo";
|
||||||
import MyOffersPage from "./views/MyOffersPage";
|
import LndPage from "./views/LndPage";
|
||||||
import MyPastDueJobsPage from "./views/MyPastDueJobsPage";
|
|
||||||
import MyReviewDueJobsPage from "./views/MyReviewDueJobsPage";
|
|
||||||
import MyTaskPage from "./views/MyTaskPage";
|
|
||||||
import MyWaitingJobsPage from "./views/MyWaitingJobsPage";
|
|
||||||
import MyWalletPage from "./views/MyWalletPage";
|
|
||||||
import OffersInterestPage from "./views/OffersInterestPage";
|
|
||||||
import ReferralPage from "./views/ReferralPage";
|
|
||||||
import RemindersPage from "./views/RemindersPage";
|
|
||||||
import ResourcePage from "./views/ResourcePage";
|
|
||||||
import SavedPage from "./views/SavedPage";
|
|
||||||
import SellPage from "./views/SellPage";
|
|
||||||
import SettingsPage from "./views/SettingsPage";
|
|
||||||
import SignupPage from "./views/SignupPage";
|
import SignupPage from "./views/SignupPage";
|
||||||
import SignupPageTwo from "./views/SignupPageTwo";
|
import SignupPageTwo from "./views/SignupPageTwo";
|
||||||
import TrackingPage from "./views/TrackingPage";
|
|
||||||
import UpdatePasswordPages from "./views/UpdatePasswordPages";
|
import UpdatePasswordPages from "./views/UpdatePasswordPages";
|
||||||
import UpdatePasswordPagesTwo from "./views/UpdatePasswordPagesTwo";
|
import UpdatePasswordPagesTwo from "./views/UpdatePasswordPagesTwo";
|
||||||
import UploadProductPage from "./views/UploadProductPage";
|
|
||||||
import UserProfilePage from "./views/UserProfilePage";
|
|
||||||
import VerifyLinkPages from "./views/VerifyLinkPages";
|
import VerifyLinkPages from "./views/VerifyLinkPages";
|
||||||
import VerifyLinkPagesTwo from "./views/VerifyLinkPagesTwo";
|
import VerifyLinkPagesTwo from "./views/VerifyLinkPagesTwo";
|
||||||
import VerifyPasswordPages from "./views/VerifyPasswordPages";
|
import VerifyPasswordPages from "./views/VerifyPasswordPages";
|
||||||
import VerifyPasswordPagesTwo from "./views/VerifyPasswordPagesTwo";
|
import VerifyPasswordPagesTwo from "./views/VerifyPasswordPagesTwo";
|
||||||
import VerifyYouPages from "./views/VerifyYouPages";
|
import VerifyYouPages from "./views/VerifyYouPages";
|
||||||
import VerifyYouPagesTwo from "./views/VerifyYouPagesTwo";
|
import VerifyYouPagesTwo from "./views/VerifyYouPagesTwo";
|
||||||
import YourPages from "./views/YourPage_";
|
import FacebookRedirect from "./views/FacebookRedirect";
|
||||||
import ParentWaitingPage from "./views/ParentWaitingPage";
|
|
||||||
import FamilyPendingOfferPage from "./views/FamilyPendingOfferPage";
|
|
||||||
import FamBlogPage from "./views/FamBlogPage"
|
|
||||||
import FamAIQuestionPage from "./views/FamAIQuestionPage"
|
|
||||||
import FamMyFilesPage from "./views/FamMyFilesPage"
|
|
||||||
import FamWorkInProgressPage from "./views/FamWorkInProgressPage";
|
|
||||||
import MyPastDueTasksPage from "./views/MyPastDueTasksPage";
|
|
||||||
import FamilyWalletPage from "./views/FamilyWalletPage";
|
|
||||||
import FamilyActivitiesPage from "./views/FamilyActivitiesPage";
|
|
||||||
import FamGamesPage from "./views/FamGamesPage";
|
|
||||||
import FamilyRoutesPage from "./views/FamilyRoutesPage";
|
|
||||||
import PromoPage from "./views/PromoPage";
|
import PromoPage from "./views/PromoPage";
|
||||||
|
import PromoRefer from './views/PromoRefer';
|
||||||
|
import InviteRefer from './views/InviteRefer';
|
||||||
|
import MyRefer from './views/MyRefer';
|
||||||
|
|
||||||
|
|
||||||
|
const HomePages = lazy(() => import("./views/HomePages"));
|
||||||
|
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
||||||
|
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
||||||
|
const Notification = lazy(() => import("./components/Notification"));
|
||||||
|
const AuthRoute = lazy(() => import("./middleware/AuthRoute"));
|
||||||
|
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
||||||
|
const BlogPage = lazy(() => import("./views/BlogPage"));
|
||||||
|
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
||||||
|
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
||||||
|
|
||||||
|
const HistoryPage = lazy(()=> import("./views/HistoryPage"));
|
||||||
|
const JobGroupsPage = lazy(()=> import("./views/JobGroupsPage"));
|
||||||
|
const ManageActiveJobs = lazy(()=> import("./views/ManageActiveJobs"));
|
||||||
|
const ManageInterestOfferPage = lazy(()=> import("./views/ManageInterestOfferPage"));
|
||||||
|
const MarketPlacePage = lazy(()=> import("./views/MarketPlacePage"));
|
||||||
|
const MyActiveJobsPage = lazy(()=> import("./views/MyActiveJobsPage"));
|
||||||
|
const MyCouponPage = lazy(()=> import("./views/MyCouponPage"));
|
||||||
|
const MyJobsPage = lazy(()=> import("./views/MyJobsPage"));
|
||||||
|
const MyOffersPage = lazy(()=> import("./views/MyOffersPage"));
|
||||||
|
const MyPastDueJobsPage = lazy(()=> import("./views/MyPastDueJobsPage"));
|
||||||
|
const MyReviewDueJobsPage = lazy(()=> import("./views/MyReviewDueJobsPage"));
|
||||||
|
const MyTaskPage = lazy(()=> import("./views/MyTaskPage"));
|
||||||
|
const MyWaitingJobsPage = lazy(()=> import("./views/MyWaitingJobsPage"));
|
||||||
|
const MyWalletPage = lazy(()=> import("./views/MyWalletPage"));
|
||||||
|
const OffersInterestPage = lazy(()=> import("./views/OffersInterestPage"));
|
||||||
|
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
||||||
|
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
||||||
|
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
||||||
|
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
||||||
|
const TrackingPage = lazy(()=> import("./views/TrackingPage"));
|
||||||
|
const UploadProductPage = lazy(()=> import("./views/UploadProductPage"));
|
||||||
|
const UserProfilePage = lazy(()=> import("./views/UserProfilePage"));
|
||||||
|
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"));
|
||||||
|
|
||||||
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
|
||||||
@@ -93,8 +100,10 @@ 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="/promo/:name/:id" element={<PromoPage />} />
|
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
||||||
|
<Route exact path="/promoref" element={<PromoRefer />} />
|
||||||
|
<Route exact path="/invite" element={<InviteRefer />} />
|
||||||
|
<Route exact path="/myrefer/:refer_link" element={<MyRefer />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -124,92 +133,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="/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 |
@@ -0,0 +1,12 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" id="add-friend" x="0" y="0" enable-background="new 0 0 56 56" version="1.1" viewBox="0 0 56 56">
|
||||||
|
<g id="_x34_">
|
||||||
|
<path fill="#ff614b" d="M20.1520596 48.5122223c-6.969367.6334381-16.1360435-2.538559-16.1360435-9.5089226 0-6.7552567 9.3379993-12.8340607 19.1365566-10.1025429C11.6365042 32.0076103 8.5797586 43.9628181 20.1520596 48.5122223zM23.2281342 21.9498482c-1.3167553 1.6189995-3.0113163 2.7414837-4.8678036 2.7414837-4.155407 0-7.544529-5.6017437-7.544529-9.7464113 0-6.0081682 6.6323166-9.4670734 11.4841213-6.4004383-1.3815784 1.4355316-2.223423 3.389122-2.223423 5.5477886C20.0764999 16.6826973 21.3177586 19.8127232 23.2281342 21.9498482z"></path>
|
||||||
|
<path d="M36.0304298 47.965065c-4.6939316 1.9150925-10.9132786 1.956356-15.6842041.0958252-.0213013-.0090942-.0412598-.0187378-.0639648-.0250244-11.5273151-4.5492096-7.7401743-16.8518009 4.2484741-18.9360332.30867.8989487 1.012928 1.4676666 1.9118042 1.8097534l-2.2802734 9.73419c-.1025391.4355469.03125.9023438.3491211 1.2177734l3.8803711 3.8544922c.2107143.2096252.5543423.188858.7397461-.0380859l3.3261719-4.0585938c.2789803-.3397827.3200912-.5983696.1914063-1.0166016-1.1257496-3.7452698.1548195.6061249-2.7582397-9.5864239.9509258-.3161449 1.663147-.9907551 2.2283325-1.8195801 3.4285889.5916748 6.3656006 2.1239014 8.2872314 4.3503399.1802521.2088089.496357.2312813.7050781.0517578.2089844-.1806641.2324219-.4970703.0517578-.7060547-2.1342773-2.4716778-5.3999023-4.1562481-9.1958008-4.7431622-.0008545-.0001221-.0016479.0002441-.0025024.0001221-.2167149-.0316906-.4131889.0921535-.4998169.2335205-.0004272.0006714-.0011597.0010376-.0015869.001709-.4018555.6640625-.8833008 1.1640625-1.4296875 1.4873047-1.3619595.8058376-4.409462.3548889-4.6435547-1.3857422-.0373135-.2786045-.2598305-.4986324-.766119-.4238281-.5176334.0825806-1.0214176.1906738-1.5172062.3118896C13.0129108 25.6687794 3.5157814 31.9572849 3.5157814 39.0031509c0 7.2062569 9.1560717 10.6395416 16.5500488 10.015564 4.9281864 1.9016037 11.3733406 1.899971 16.3425293-.1278687.2553711-.1044922.378418-.3964844.2739258-.6513672C36.5777931 47.9826431 36.2858009 47.8605728 36.0304298 47.965065zM28.9718361 31.4416294l.4660034 1.6382427c-.1742687.0852623.0627537-.0866661-3.2201538 3.1741943l1.1130371-4.7518902C27.8272762 31.4898281 28.4199524 31.4561787 28.9718361 31.4416294zM25.1358986 40.8722916l.649231-2.7717896 3.9557495-3.9552612.9927979 3.4902954-4.7506104 4.2474976c-.0058594.005249-.0079346.0126343-.0134888.0180664l-.7536011-.7485352C25.1432228 41.0793228 25.1124611 40.9728775 25.1358986 40.8722916zM31.6827736 40.9875259l-2.9765625 3.6318359-2.0285645-2.0148926 4.3604736-3.8986816c.7511387 2.5571251.4453716 1.4923744.6549072 2.1899414C31.7027931 40.9279556 31.7159767 40.9601822 31.6827736 40.9875259zM4.5157814 39.0031509c0-5.8982773 7.6678896-11.4824982 16.6328735-10.0299053-9.6517429 3.5520725-12.3788052 14.0203838-3.1348267 19.1047955C10.2978249 47.9708633 4.5157814 44.1104507 4.5157814 39.0031509zM23.2516823 22.6767979c1.3936768 1.3889771 3.0743408 2.2960815 4.8578491 2.2960815 3.8608398 0 6.9887695-4.0351563 8.0830078-8.0214844.0732422-.2666016-.0834961-.5419922-.3496094-.6152344-.2675781-.0703125-.5419922.0839844-.6142578.3496094-.9697266 3.5332031-3.7944336 7.2871094-7.1191406 7.2871094-4.1438522 0-7.5332031-5.7720966-7.5332031-9.8808603 0-4.1711521 3.4018421-7.5205073 7.5214844-7.5205073 3.9272461 0 7.2163086 3.0712886 7.487793 6.9912105.0195313.2753906.2602539.4755859.5336914.4648438.2753906-.0195313.4833984-.2578125.4643555-.5332031-.4944992-7.1314373-9.1289673-10.5536861-14.3618164-5.558105-5.3048058-2.9869342-11.90625.8975091-11.90625 7.0083003C10.3155861 21.4710331 17.3002548 29.2743626 23.2516823 22.6767979zM21.5162697 8.6711206c-3.2331066 3.9059381-2.063303 9.517417 1.0541992 13.2802744-5.3480682 6.0405064-11.2548828-1.5758038-11.2548828-7.0068369C11.3155861 9.6542807 16.9414864 6.3203502 21.5162697 8.6711206zM49.5030861 33.2590103l-1.8736572-.184082c.0150757-.0079346.0324707-.0045166.0469971-.0141602 6.2281075-4.1175671 6.166069-13.8392754 1.1938477-16.9414043-.0844727-2.0888681-.8623047-3.9804697-2.1958008-5.243165-1.9521484-1.8457031-5.0620117-2.0644531-6.934082-.4853516-.2114258.1777344-.237793.4931641-.0600586.7041016.1782227.2109375.4931641.2373047.7045898.0595703 1.4697266-1.2392578 4.034668-1.0351563 5.6020508.4482422 1.0302734.9746094 1.6738281 2.4042969 1.8452148 4.0136719-3.2912941-1.1423397-6.6737289 1.6315832-5.0351563 4.7509775 1.415638 2.6920357 5.6048317 2.0048065 6.0458984-3.0429688 3.8890877 3.1670475 3.621582 11.1923389-1.5643311 14.7892437l.4412842-.9708843c.2745361-.6030388-.6399498-1.0150375-.9101563-.4140625l-.824707 1.8144512c-.3768578.8212128.0631943 1.3852425.9770508 1.4716797l2.4433594.2402344C50.0908356 34.2954216 50.1399155 33.3223534 49.5030861 33.2590103zM43.6822853 19.9015903c-1.2788124-2.4307442 1.6810646-4.3558064 4.1933594-3.1884766C47.761219 21.1266956 44.6973381 21.8336697 43.6822853 19.9015903z"></path>
|
||||||
|
<g>
|
||||||
|
<circle cx="41.237" cy="41.649" r="8.435" fill="#f7d01c" transform="rotate(-76.717 41.237 41.649)"></circle>
|
||||||
|
</g>
|
||||||
|
<path d="M44.2379494,41.1486588H42.244297v-1.9941406c0-0.2763672-0.2236328-0.5-0.5-0.5s-0.5,0.2236328-0.5,0.5v1.9941406
|
||||||
|
h-1.9936523c-0.2763672,0-0.5,0.2236328-0.5,0.5s0.2236328,0.5,0.5,0.5h1.9936523v1.9941406c0,0.2763672,0.2236328,0.5,0.5,0.5
|
||||||
|
s0.5-0.2236328,0.5-0.5v-1.9941406h1.9936523c0.2763672,0,0.5-0.2236328,0.5-0.5S44.5143166,41.1486588,44.2379494,41.1486588z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" id="resources" enable-background="new 0 0 48 48" viewBox="0 0 48 48">
|
||||||
|
<ellipse cx="9.1" cy="5.4" fill="#ffd499" rx="4.4" ry="4.9"></ellipse>
|
||||||
|
<path fill="#b0f0a8" d="M20.2,22.2c0.5,0,1-0.2,1.4-0.6l5-5c0.8-0.8,0.8-2,0-2.8c-0.8-0.8-2-0.8-2.8,0l-3.7,3.7L15.1,13c-0.1-0.1-0.2-0.2-0.4-0.3c-1.2-1-2.8-1.5-4.4-1.5H7.9c-4.1,0-7.4,3.4-7.4,7.5v11.3h3.1v14.6c0,1.6,1.2,2.8,2.8,2.8c1.3,0,2.4-0.9,2.7-2.2c0.3,1.3,1.4,2.2,2.7,2.2c1.5,0,2.8-1.3,2.8-2.8V17.9l4.4,3.9C19.3,22.1,19.8,22.2,20.2,22.2z"></path>
|
||||||
|
<path fill="#c1e5ff" d="M39.8 45.1c1.8-.9 3.4-2.2 4.7-3.8h-2.8C41.2 42.8 40.6 44.1 39.8 45.1zM34.8 46.4c1.7-.6 3.2-2.5 4.3-5h-4.3V46.4zM42.4 38.9h3.6c.8-1.5 1.3-3.2 1.4-5h-4.4C43 35.7 42.8 37.4 42.4 38.9zM44.5 24c-1.3-1.6-2.8-2.9-4.7-3.8.7 1.1 1.4 2.4 1.9 3.8H44.5zM39.9 26.4h-5.1v5h5.8C40.6 29.7 40.3 28 39.9 26.4zM43.1 31.5h4.4c-.2-1.8-.7-3.5-1.4-5h-3.6C42.8 28 43 29.7 43.1 31.5zM34.8 19v5h4.3C38 21.4 36.5 19.6 34.8 19zM40.7 33.9h-5.8v5h5.1C40.3 37.4 40.6 35.7 40.7 33.9zM28.1 24h4.3v-5C30.7 19.6 29.2 21.4 28.1 24zM22.7 41.4c1.3 1.6 2.8 2.9 4.7 3.8-.7-1.1-1.4-2.4-1.9-3.8H22.7zM24.1 33.9h-4.4c.2 1.8.7 3.5 1.4 5h3.6C24.4 37.4 24.2 35.7 24.1 33.9zM26.6 31.5h5.8v-5h-5.1C26.9 28 26.7 29.7 26.6 31.5zM32.4 46.4v-5h-4.3C29.2 43.9 30.7 45.8 32.4 46.4zM27.4 20.2c-1.8.9-3.4 2.2-4.7 3.8h2.8C26 22.6 26.7 21.3 27.4 20.2zM27.3 38.9h5.1v-5h-5.8C26.7 35.7 26.9 37.4 27.3 38.9zM19.7 31.5h4.4c.1-1.8.3-3.5.7-5h-3.6C20.4 28 19.9 29.7 19.7 31.5z"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 672 672" id="waiting">
|
||||||
|
<path fill="#4d4d4d" d="M497 595H175a7 7 0 0 1-7-7v-79.237a112.163 112.163 0 0 1 37.076-83.249L304.536 336l-99.46-89.515A112.163 112.163 0 0 1 168 163.236V119a7 7 0 0 1 14 0v44.236a98.142 98.142 0 0 0 32.441 72.843L319.683 330.8a7 7 0 0 1 0 10.406L214.441 435.92A98.142 98.142 0 0 0 182 508.763V581h308v-72.237a98.142 98.142 0 0 0-32.441-72.843L352.317 341.2a7 7 0 0 1 0-10.406l105.242-94.718A98.142 98.142 0 0 0 490 163.236V119a7 7 0 0 1 14 0v44.236a112.163 112.163 0 0 1-37.076 83.249L367.464 336l99.46 89.514A112.163 112.163 0 0 1 504 508.763V588a7 7 0 0 1-7 7Z"></path>
|
||||||
|
<path fill="#5b96ff" d="M440.679 207.553a7 7 0 0 0-6.535-4.492H237.856a7 7 0 0 0-4.682 12.2l98.143 88.339a7 7 0 0 0 9.366 0l98.143-88.334a7 7 0 0 0 1.853-7.713Z"></path>
|
||||||
|
<path fill="#5b95ff" d="M330.475 469.1 238 588h196l-92.475-118.9a7 7 0 0 0-11.05 0Z"></path>
|
||||||
|
<rect width="420" height="35" x="126" y="49" fill="#ebeff2" rx="17.5"></rect>
|
||||||
|
<rect width="420" height="35" x="126" y="588" fill="#ebeff2" rx="17.5"></rect>
|
||||||
|
<path fill="#4d4d4d" d="M528.5 91h-385a24.5 24.5 0 0 1 0-49h385a24.5 24.5 0 0 1 0 49zm-385-35a10.5 10.5 0 0 0 0 21h385a10.5 10.5 0 0 0 0-21zm385 574h-385a24.5 24.5 0 0 1 0-49h385a24.5 24.5 0 0 1 0 49zm-385-35a10.5 10.5 0 0 0 0 21h385a10.5 10.5 0 0 0 0-21z"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 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,
|
||||||
@@ -39,7 +39,7 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await ApiCall.jobManagerCreateJob(reqData);
|
const res = await ApiCall.jobManagerCreateJob(reqData);
|
||||||
if (res.data.internal_return < 1) {
|
if (res?.data?.internal_return < 1) {
|
||||||
setRequestStatus({
|
setRequestStatus({
|
||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
@@ -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,18 +117,18 @@ 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="">
|
||||||
Loading...
|
Loading...
|
||||||
</option>
|
</option>
|
||||||
) : walletDetails.data.length > 1 ? (
|
) : walletDetails?.data?.length > 1 ? (
|
||||||
<>
|
<>
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Select a currency
|
Select a currency
|
||||||
</option>
|
</option>
|
||||||
{walletDetails.data?.map((item, index) => (
|
{walletDetails?.data?.map((item, index) => (
|
||||||
<option
|
<option
|
||||||
key={index}
|
key={index}
|
||||||
className="text-slate-500 text-lg"
|
className="text-slate-500 text-lg"
|
||||||
@@ -138,9 +138,9 @@ 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
|
||||||
key={index}
|
key={index}
|
||||||
className="text-slate-500 text-lg"
|
className="text-slate-500 text-lg"
|
||||||
@@ -184,10 +184,10 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
className="job-label job-label-flex"
|
className="job-label job-label-flex"
|
||||||
htmlFor="timeline_days"
|
htmlFor="timeline_days"
|
||||||
>
|
>
|
||||||
Timeline
|
Delivery Timeline
|
||||||
<span className="text-green-700 text-[12px] tracking-wide">
|
{/* <span className="text-green-700 text-[12px] tracking-wide">
|
||||||
- Duration
|
- Duration
|
||||||
</span>
|
</span> */}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<Field
|
<Field
|
||||||
@@ -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]`}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ const validationSchema = Yup.object().shape({
|
|||||||
.required("Price is required"),
|
.required("Price is required"),
|
||||||
title: Yup.string()
|
title: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
.max(149, "Maximum 149 characters")
|
.max(80, "Maximum 80 characters")
|
||||||
.required("Title is required"),
|
.required("Title is required"),
|
||||||
description: Yup.string()
|
description: Yup.string()
|
||||||
.min(5, "Minimum 5 characters")
|
.min(5, "Minimum 5 characters")
|
||||||
|
|||||||
@@ -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,83 @@ 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={process.env.REACT_APP_HOME_LINK}
|
||||||
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
|
Home
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://www.wrenchboard.com/service"
|
href={process.env.REACT_APP_ABOUT_LINK}
|
||||||
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
|
About
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://www.wrenchboard.com/contact"
|
// href="https://www.wrenchboard.com/service"
|
||||||
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
href={process.env.REACT_APP_TERMS_LINK}
|
||||||
target="_blank"
|
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
||||||
rel="noreferrer"
|
target="_blank"
|
||||||
>
|
rel="noreferrer"
|
||||||
Contact Us
|
>
|
||||||
</a>
|
Terms
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href={process.env.REACT_APP_CONTACTS_LINK}
|
||||||
|
className="text-[#a1a5b7] text-[15px] px-2 font-medium hover:text-[#009ef7]"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
Contact Us
|
||||||
|
</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);
|
||||||
@@ -63,7 +63,7 @@ export default function ForgotPassword() {
|
|||||||
setResetLoading(true);
|
setResetLoading(true);
|
||||||
try {
|
try {
|
||||||
const res = await userApi.StartResetPassword(reqData);
|
const res = await userApi.StartResetPassword(reqData);
|
||||||
if (res.status === 200) {
|
if (res.status === 200 && res?.data?.internal_return >= 0) {
|
||||||
setMsgSuccess(true);
|
setMsgSuccess(true);
|
||||||
setMail("");
|
setMail("");
|
||||||
setValue(false);
|
setValue(false);
|
||||||
@@ -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,124 @@
|
|||||||
|
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
|
||||||
|
className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition"
|
||||||
|
>
|
||||||
|
Sign Up in App Store
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* <div className="login-links mt-10 flex justify-center text-gray-400 divide-x-4">
|
||||||
|
<a className='text-sm font-bold px-5' href={process.env.REACT_APP_HOME_LINK}>Home</a>
|
||||||
|
<a className='text-sm font-bold px-5' href={process.env.REACT_APP_ABOUT_LINK}>About</a>
|
||||||
|
<a className='text-sm font-bold px-5' href={process.env.REACT_APP_CONTACTS_LINK}>Contact</a>
|
||||||
|
<a className='text-sm font-bold px-5' href={process.env.REACT_APP_TERMS_LINK}>Terms</a>
|
||||||
|
</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(() => {
|
||||||
|
|||||||
@@ -16,13 +16,17 @@ import { updateUserDetails } from "../../../store/UserDetails";
|
|||||||
|
|
||||||
import ReCAPTCHA from "react-google-recaptcha";
|
import ReCAPTCHA from "react-google-recaptcha";
|
||||||
|
|
||||||
|
import GoogleDownload from '../../../assets/images/download/andriod.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")
|
||||||
@@ -30,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);
|
||||||
|
|
||||||
@@ -196,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("");
|
||||||
@@ -256,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}
|
||||||
@@ -264,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> */}
|
||||||
@@ -296,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 ${
|
||||||
@@ -324,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
|
||||||
@@ -387,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"
|
||||||
@@ -521,48 +526,54 @@ export default function Login() {
|
|||||||
)
|
)
|
||||||
// END of family login compoenent
|
// END of family login compoenent
|
||||||
}
|
}
|
||||||
|
<div className='mt-4 w-full flex justify-center items-center text-center'>
|
||||||
|
<Link className='px-4 py-2 rounded-full text-xl text-white bg-[#4687ba] hover:bg-[#009ef7] transition-all duration-300 items-center text-[15px]' 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-28 lg:w-32">
|
<div className="w-32 lg:w-48">
|
||||||
<a
|
<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"
|
// 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"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
href={process.env.REACT_APP_APPLE_APP}
|
||||||
>
|
>
|
||||||
<i className="fa-brands fa-apple text-3xl"></i>
|
{/* <i className="fa-brands fa-apple text-3xl"></i>
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
App Store
|
App Store
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={IOSDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-28 lg:w-32">
|
<div className="w-32 lg:w-48">
|
||||||
<a
|
<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"
|
// 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"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
href={process.env.REACT_APP_ANDROID_APP}
|
||||||
>
|
>
|
||||||
<i className="fa-brands fa-google-play text-2xl"></i>
|
{/* <i className="fa-brands fa-google-play text-2xl"></i>
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<span className="text-[11px]">Available on the</span>
|
<span className="text-[11px]">Available on the</span>
|
||||||
<span className="text-[12px] lg:text-base">
|
<span className="text-[12px] lg:text-base">
|
||||||
Google Play
|
Google Play
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div> */}
|
||||||
|
<img src={GoogleDownload} className='w-full h-auto' alt='IOS Download' />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{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>
|
||||||
@@ -610,7 +621,7 @@ const BrandBtn = ({
|
|||||||
className="w-full border border-light-purple rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 items-center font-medium cursor-pointer"
|
className="w-full border border-light-purple rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 items-center font-medium cursor-pointer"
|
||||||
>
|
>
|
||||||
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
||||||
<span className="text-lg text-thin-light-gray font-normal text-[15px]">
|
<span className="text-thin-light-gray font-normal text-sm">
|
||||||
Continue with {brand}
|
Continue with {brand}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
@@ -621,7 +632,7 @@ const BrandBtn = ({
|
|||||||
className="w-full border border-light-purple rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 items-center font-medium cursor-pointer"
|
className="w-full border border-light-purple rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 items-center font-medium cursor-pointer"
|
||||||
>
|
>
|
||||||
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
||||||
<span className="text-lg text-thin-light-gray font-normal text-[15px]">
|
<span className="text-thin-light-gray font-normal text-sm">
|
||||||
Continue with {brand}
|
Continue with {brand}
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -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-between items-center gap-10 sm:gap-32">
|
|
||||||
<div className="w-full">
|
|
||||||
<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-full">
|
|
||||||
<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);
|
||||||
|
|||||||
@@ -5,15 +5,25 @@ 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";
|
||||||
|
|
||||||
export default function SignUp() {
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
|
/* Note
|
||||||
|
The Props in this component
|
||||||
|
1. refer_link holds the value to be sent as the referral code
|
||||||
|
2. details holds the value of the person either referred via invite or promo
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default function SignUp({refer_link, 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);
|
||||||
@@ -24,9 +34,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.firstname : "",
|
||||||
last_name: "",
|
last_name: details ? details.lastname : "",
|
||||||
email: "",
|
email: details ? details.email : "",
|
||||||
password: "",
|
password: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -100,6 +110,7 @@ export default function SignUp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSignUpLoading(true);
|
setSignUpLoading(true);
|
||||||
|
let referral_link = refer_link ? {refer_link} : {} // FOR USER COMING FROM REFERRAL PROCESS
|
||||||
const reqData = {
|
const reqData = {
|
||||||
country: country,
|
country: country,
|
||||||
firstname: first_name,
|
firstname: first_name,
|
||||||
@@ -109,6 +120,7 @@ export default function SignUp() {
|
|||||||
password: password,
|
password: password,
|
||||||
terms: 1,
|
terms: 1,
|
||||||
news: 1,
|
news: 1,
|
||||||
|
...referral_link
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await userApi.CreateUser(reqData);
|
const res = await userApi.CreateUser(reqData);
|
||||||
@@ -154,15 +166,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">
|
||||||
@@ -207,6 +210,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.first_name}
|
value={formData.first_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item flex-1">
|
<div className="input-item flex-1">
|
||||||
@@ -218,6 +222,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.last_name}
|
value={formData.last_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -230,6 +235,7 @@ export default function SignUp() {
|
|||||||
type="email"
|
type="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details ? true : false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item mb-4">
|
<div className="input-item mb-4">
|
||||||
@@ -276,16 +282,17 @@ 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
|
<a
|
||||||
href="#"
|
target='_blank'
|
||||||
className="text-base text-[#4687ba] hover:text-[#009ef7] mx-1 inline-block"
|
href={process.env.REACT_APP_TERMS_LINK}
|
||||||
|
className="font-semibold text-[#4687ba] hover:text-[#009ef7] transition mx-1 inline-block"
|
||||||
>
|
>
|
||||||
terms and condition
|
terms and condition
|
||||||
</Link>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -343,44 +350,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-28 lg:w-32">
|
|
||||||
<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"
|
|
||||||
href={process.env.REACT_APP_APPLE_APP}
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<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>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div className="w-28 lg:w-32">
|
|
||||||
<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"
|
|
||||||
href={process.env.REACT_APP_ANDROID_APP}
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
<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>
|
|
||||||
</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){
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default function OfferCard({
|
|||||||
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
|
let image = `${image_server}${localStorage.getItem("session_token")}/job/${datas.job_uid}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card-style-one flex flex-col justify-between w-full h-[387px] bg-white dark:bg-dark-white p-3 pb rounded-2xl">
|
<div className="card-style-one flex flex-col gap-3 justify-between w-full bg-white dark:bg-dark-white p-3 rounded-2xl">
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<div className="w-full h-40">
|
<div className="w-full h-40">
|
||||||
{/* thumbnail image/video */}
|
{/* thumbnail image/video */}
|
||||||
@@ -46,24 +46,24 @@ export default function OfferCard({
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
|
<div className="w-full p-2 rounded-lg border border-[#E3E4FE] dark:border-[#a7a9b533] ">
|
||||||
<div className="grid grid-cols-1 gap-2">
|
{/* <div className="grid grid-cols-1 gap-2">
|
||||||
{/* <div className="flex flex-col justify-between items-center border-r-2">
|
<div className="flex flex-col justify-between items-center border-r-2">
|
||||||
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
||||||
Task Code
|
Task Code
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
{datas.contract}
|
{datas.contract}
|
||||||
</p>
|
</p>
|
||||||
</div> */}
|
</div>
|
||||||
<div className="flex flex-col justify-between items-center">
|
<div className="flex flex-col justify-between items-center">
|
||||||
<p className="text-sm text-red-500 tracking-wide">Expires</p>
|
<p className="text-sm text-red-500 tracking-wide">Expires</p>
|
||||||
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
<CountDown lastDate={datas.expire} />
|
<CountDown lastDate={datas.expire} />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
<hr className="my-2" />
|
{/* <hr className="my-2" /> */}
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-2">
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<div className="flex flex-col justify-between items-center border-r-2">
|
<div className="flex flex-col justify-between items-center border-r-2">
|
||||||
@@ -74,13 +74,19 @@ export default function OfferCard({
|
|||||||
{thePrice}
|
{thePrice}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col justify-between items-center">
|
{/* <div className="flex flex-col justify-between items-center">
|
||||||
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
<p className="text-sm text-thin-light-gray dark:text-white tracking-wide">
|
||||||
Timeline
|
Timeline
|
||||||
</p>
|
</p>
|
||||||
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
{`${datas.timeline_days} day(s)`}
|
{`${datas.timeline_days} day(s)`}
|
||||||
</p>
|
</p>
|
||||||
|
</div> */}
|
||||||
|
<div className="flex flex-col justify-between items-center">
|
||||||
|
<p className="text-sm text-red-500 tracking-wide">Expires</p>
|
||||||
|
<p className="text-base font-bold tracking-wide text-dark-gray dark:text-white">
|
||||||
|
<CountDown lastDate={datas.expire} />
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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,8 +84,9 @@ 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
|
||||||
|
|
||||||
}, [socket]);
|
}, [socket]);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
|
|||||||
|
|
||||||
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
let [offerPopout, setOfferPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW
|
||||||
|
|
||||||
let offersListLength = offersList?.length
|
let offersListLength = offersList?.length > 2 ? 2 : offersList?.length
|
||||||
|
|
||||||
// getting the upper three banners for the home layout
|
// getting the upper three banners for the home layout
|
||||||
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
|
const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2 - offersListLength);
|
||||||
@@ -31,8 +31,8 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|
||||||
|
{/* for normal banner section */}
|
||||||
<div className="w-full grid xxs:grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 items-center justify-center gap-2 md:gap-4">
|
<div className="w-full grid xxs:grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 items-center justify-center gap-2 md:gap-4">
|
||||||
|
|
||||||
{/* OFFER LIST DISPLAY */}
|
{/* OFFER LIST DISPLAY */}
|
||||||
<>
|
<>
|
||||||
{(offersList && offersList?.length > 0) &&
|
{(offersList && offersList?.length > 0) &&
|
||||||
@@ -44,11 +44,13 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
|
|||||||
);
|
);
|
||||||
|
|
||||||
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
|
let image = `${imageServer}${localStorage.getItem("session_token")}/job/${item.job_uid}`
|
||||||
return (
|
if(index < offersListLength){
|
||||||
<div key={item.id}>
|
return (
|
||||||
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
|
<div key={item.offer_uid}>
|
||||||
</div>
|
<NewOfferCard datas={item} image={image} price={thePrice} setOfferPopout={setOfferPopout} />
|
||||||
)
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
|
|
||||||
@@ -71,7 +73,12 @@ const AccountDashboard = ({ className, bannerList, offersList, imageServer }) =>
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full grid-cols-1 md:grid-cols-2 2xl::grid-cols-3 grid items-center justify-center gap-2 md:gap-4">
|
|
||||||
|
|
||||||
|
{/* for flat banner section */}
|
||||||
|
<div className="w-full grid-cols-1 md:grid-cols-2 2xl:grid-cols-3 grid items-center justify-center gap-2 md:gap-4">
|
||||||
|
{/* OFFER LIST DISPLAY */}
|
||||||
|
|
||||||
{getLowerBanner?.map((props, idx) => {
|
{getLowerBanner?.map((props, idx) => {
|
||||||
let image = getImage(props);
|
let image = getImage(props);
|
||||||
|
|
||||||
@@ -125,15 +132,15 @@ const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => {
|
|||||||
</Link>
|
</Link>
|
||||||
<div className="rounded-b-xl bg-white dark:bg-dark-white">
|
<div className="rounded-b-xl bg-white dark:bg-dark-white">
|
||||||
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2 dark:text-white">
|
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2 dark:text-white">
|
||||||
<Link to={link_path} className="font-bold text-lg line-clamp-1">
|
<Link to={link_path} className="font-bold text-xl line-clamp-1">
|
||||||
{title}
|
{title}
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={link_path} className="text-sm">
|
<Link to={link_path} className="text-base line-clamp-1">
|
||||||
{desc}
|
{desc}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between w-full p-1 items-center">
|
<div className="flex justify-between w-full p-1 items-center">
|
||||||
<Link to={link_path} className="text-slate-300 font-semibold text-sm">
|
<Link to={link_path} className="text-slate-300 font-semibold text-base">
|
||||||
{btn}
|
{btn}
|
||||||
</Link>
|
</Link>
|
||||||
<button className="flex items-center justify-center gap-2">
|
<button className="flex items-center justify-center gap-2">
|
||||||
@@ -160,30 +167,34 @@ const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) =
|
|||||||
<div
|
<div
|
||||||
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
|
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${image}) center / contain no-repeat`,
|
// background: `url(${image}) center / contain no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{/* <img src={image} className='' /> */}
|
||||||
|
<div
|
||||||
|
className="thumbnail w-full h-full rounded-xl overflow-hidden"
|
||||||
|
style={{
|
||||||
|
background: `url(${image}) center / contain no-repeat`,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
{hidden && <div className="flex justify-center"></div>}
|
{hidden && <div className="flex justify-center"></div>}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="rounded-b-xl bg-transparent dark:bg-dark-transparent">
|
<div className="rounded-b-xl bg-transparent dark:bg-dark-transparent">
|
||||||
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2 dark:text-white">
|
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2 dark:text-white">
|
||||||
<h1 className="font-bold text-lg line-clamp-1 text-center">
|
<h1 className="font-bold text-xl line-clamp-1 text-center">
|
||||||
{datas?.title}
|
{datas?.title}
|
||||||
</h1>
|
</h1>
|
||||||
{/* <Link to={link_path} className="text-sm">
|
|
||||||
{desc}
|
|
||||||
</Link> */}
|
|
||||||
<div className="card-buttons flex justify-center items-center space-x-2">
|
<div className="card-buttons flex justify-center items-center space-x-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setOfferPopout({ show: true, data: { ...datas, price, image } })
|
setOfferPopout({ show: true, data: { ...datas, image } })
|
||||||
}
|
}
|
||||||
className="btn-shine w-2/3 h-[40px] text-white rounded-full text-sm bg-pink flex justify-center items-center"
|
className="btn-shine w-2/3 h-[40px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
||||||
>
|
>
|
||||||
Start Task
|
Start Now
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -205,6 +216,62 @@ const NewOfferCard = ({ datas, hidden = false, price, setOfferPopout, image }) =
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const NewOfferCardFlat = ({ datas, hidden = false, price, setOfferPopout, image }) => {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col shadow-md bg-red-50 dark:bg-dark-white rounded-xl dark:border-[#5356fb29] overflow-hidden">
|
||||||
|
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
|
||||||
|
<div className="min-h-[130px] sm:min-h-[100px] flex justify-between items-center">
|
||||||
|
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
||||||
|
<h1 className="font-bold text-xl line-clamp-1 text-center">
|
||||||
|
{datas?.title}
|
||||||
|
</h1>
|
||||||
|
<div className="card-buttons flex items-center space-x-2">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() =>
|
||||||
|
setOfferPopout({ show: true, data: { ...datas, image } })
|
||||||
|
}
|
||||||
|
className="btn-shine w-28 h-[40px] text-white rounded-full text-base bg-pink flex justify-center items-center"
|
||||||
|
>
|
||||||
|
Start Now
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='w-[150px] h-[100px]'>
|
||||||
|
{datas.job_type == "MEDIA" ?
|
||||||
|
<Suspense fallback={<p>Loading...</p>}>
|
||||||
|
<VideoElement videoId={datas?.media_uid} />
|
||||||
|
</Suspense>
|
||||||
|
:
|
||||||
|
<div
|
||||||
|
className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4"
|
||||||
|
style={{
|
||||||
|
background: `url(${image}) center / contain no-repeat`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{hidden && <div className="flex justify-center"></div>}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between w-full p-1 items-center">
|
||||||
|
<div className="flex gap-1 items-center">
|
||||||
|
<p className="text-[12px] text-red-500 tracking-wide">Expires</p>
|
||||||
|
<p className="text-[12px] font-semibold tracking-wide text-dark-gray dark:text-white">
|
||||||
|
<CountDown lastDate={datas.expire} />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<button className="flex items-center justify-center gap-2">
|
||||||
|
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
|
||||||
|
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
|
||||||
|
<div className="w-[4px] h-[4px] bg-slate-400 rounded-full"></div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type, blog_id, key }) => {
|
const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type, blog_id, key }) => {
|
||||||
const newLinkPath = card_type == 'BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path
|
const newLinkPath = card_type == 'BLOG' ? `${link_path}?blog_id=${blog_id}` : link_path
|
||||||
|
|
||||||
@@ -216,10 +283,10 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type,
|
|||||||
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
|
<div className="w-full xxs:flex justify-between items-center border-b border-slate-300 p-2">
|
||||||
<div className="min-h-[130px] sm:min-h-[100px] flex justify-between items-center">
|
<div className="min-h-[130px] sm:min-h-[100px] flex justify-between items-center">
|
||||||
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
<div className="px-2 flex flex-col gap-2 dark:text-white">
|
||||||
<Link to={newLinkPath} className="text-lg font-bold">
|
<Link to={newLinkPath} className="text-xl font-bold line-clamp-1">
|
||||||
{title}
|
{title}
|
||||||
</Link>
|
</Link>
|
||||||
<p to={newLinkPath} className="text-sm">
|
<p to={newLinkPath} className="text-base line-clamp-1">
|
||||||
{desc}
|
{desc}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -234,7 +301,7 @@ const LowerBanner = ({ image, title = "", desc = "", btn, link_path, card_type,
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between w-full p-1 items-center">
|
<div className="flex justify-between w-full p-1 items-center">
|
||||||
<Link to={newLinkPath} className="text-slate-300 font-semibold text-sm">
|
<Link to={newLinkPath} className="text-slate-300 font-semibold text-base">
|
||||||
{btn}
|
{btn}
|
||||||
</Link>
|
</Link>
|
||||||
<button className="flex items-center justify-center gap-2">
|
<button className="flex items-center justify-center gap-2">
|
||||||
@@ -285,10 +352,10 @@ const BannerSection = ({ banners, variant }) => {
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2">
|
<div className="border-b border-slate-300 px-2 py-1 h-[5.4rem] flex flex-col gap-2">
|
||||||
<Link to={link_path} className="font-bold text-lg">
|
<Link to={link_path} className="font-bold text-xl">
|
||||||
{short_title}
|
{short_title}
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={link_path} className="text-sm">
|
<Link to={link_path} className="text-base">
|
||||||
{short_description}
|
{short_description}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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,10 @@ 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 preSelectedTab = queryParams.get("tab");
|
||||||
|
|
||||||
// Initial state for family details
|
// Initial state for family details
|
||||||
const initialDetailState = {
|
const initialDetailState = {
|
||||||
@@ -65,35 +68,43 @@ export default function FamilyTableNew() {
|
|||||||
|
|
||||||
// Function to handle tab changes
|
// Function to handle tab changes
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value.toLowerCase());
|
||||||
};
|
};
|
||||||
|
|
||||||
// Object that maps tab names to their corresponding components
|
// Object that maps tab names to their corresponding components
|
||||||
const tabComponents = {
|
const tabComponents = {
|
||||||
Tasks: (
|
tasks: (
|
||||||
<FamilyTasks
|
<FamilyTasks
|
||||||
familyData={familyTasks}
|
familyData={familyTasks}
|
||||||
action={familyAssignPopUpHandler}
|
action={familyAssignPopUpHandler}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
Waiting: (
|
waiting: (
|
||||||
<FamilyWaitlist
|
<FamilyWaitlist
|
||||||
familyData={familyWaitList}
|
familyData={familyWaitList}
|
||||||
setUpdatePage={setUpdatePage}
|
setUpdatePage={setUpdatePage}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
Pending: (
|
pending: (
|
||||||
<FamilyPending
|
<FamilyPending
|
||||||
familyData={familyPending}
|
familyData={familyPending}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultTabComponent = tabComponents.Tasks;
|
const defaultTabComponent = tabComponents.tasks;
|
||||||
|
|
||||||
// Selected tab component based on the current 'tab'
|
// Selected tab component based on the current 'tab'
|
||||||
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
const selectedTabComponent = tabComponents[tab] || defaultTabComponent;
|
||||||
|
|
||||||
|
useEffect(()=>{ // EFFECT TO CHECK FOR PRE SELECTED TAB AND DEFAULT TO IT OR TO DEFAULT IF NOT AVALIABLE
|
||||||
|
if(preSelectedTab && tabs.map(item => item.name.toLowerCase()).includes(preSelectedTab.toLowerCase())){
|
||||||
|
setTab(preSelectedTab)
|
||||||
|
}else{
|
||||||
|
setTab(tabs[0].name)
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
|
|
||||||
// Effect to manage active family task details
|
// Effect to manage active family task details
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -189,7 +200,7 @@ export default function FamilyTableNew() {
|
|||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
<div className="h-full min-h-[609px] w-full overflow-hidden flex justify-center items-center">
|
<div className="h-full min-h-[609px] w-full overflow-hidden flex justify-center items-center">
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -202,7 +213,7 @@ export default function FamilyTableNew() {
|
|||||||
<li
|
<li
|
||||||
onClick={() => tabHandler(name)}
|
onClick={() => tabHandler(name)}
|
||||||
className={`p-4 flex hover:text-purple transition-all ease-in-out items-center cursor-pointer overflow-hidden text-xl relative top-[2px] ${
|
className={`p-4 flex hover:text-purple transition-all ease-in-out items-center cursor-pointer overflow-hidden text-xl relative top-[2px] ${
|
||||||
tab === name
|
tab.toLowerCase() === name.toLowerCase()
|
||||||
? "text-purple border-r"
|
? "text-purple border-r"
|
||||||
: "text-thin-light-gray"
|
: "text-thin-light-gray"
|
||||||
}`}
|
}`}
|
||||||
@@ -224,7 +235,7 @@ export default function FamilyTableNew() {
|
|||||||
<div className="flex-[0.9] h-full">
|
<div className="flex-[0.9] h-full">
|
||||||
<div className="h-full relative overflow-y-auto">
|
<div className="h-full relative overflow-y-auto">
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={<LoadingSpinner size="16" color="sky-blue" />}
|
fallback={<LoadingSpinner size="16" color="sky-blue" height='h-[30rem]' />}
|
||||||
>
|
>
|
||||||
{selectedTabComponent}
|
{selectedTabComponent}
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -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,32 @@ 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'
|
||||||
// style={{
|
// style={{
|
||||||
@@ -14,28 +37,39 @@ function Wallet({wallet, familyData, setFamilyWalletReload}) {
|
|||||||
<div className="w-full flex justify-start items-center gap-3">
|
<div className="w-full flex justify-start items-center gap-3">
|
||||||
<div className="min-w-[50px] min-h-[50px] max-w-min md:max-w-[80px] max-h-min md:max-h-[80px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
<div className="min-w-[50px] min-h-[50px] max-w-min md:max-w-[80px] max-h-min md:max-h-[80px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||||
<img
|
<img
|
||||||
src={localImgLoad(`images/currency/${(wallet.code).toLowerCase()}.svg`)}
|
src={wallet.icon}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
alt="currency-icon"
|
alt="currency-icon"
|
||||||
/>
|
/>
|
||||||
</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
|
||||||
@@ -47,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}>
|
||||||
Plan Wallet
|
<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>
|
||||||
@@ -70,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 || "",
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ export default function InputCom({
|
|||||||
direction,
|
direction,
|
||||||
tabIndex,
|
tabIndex,
|
||||||
error,
|
error,
|
||||||
autoComplete="on"
|
autoComplete="on",
|
||||||
|
minDate='1900-01-01',
|
||||||
|
maxDate='2099-09-13'
|
||||||
}) {
|
}) {
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
// Entry Validation
|
// Entry Validation
|
||||||
@@ -90,26 +92,51 @@ export default function InputCom({
|
|||||||
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
|
: "text-[#5e6278] dark:text-gray-100 bg-[#f5f8fa] border"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<input
|
<>
|
||||||
placeholder={placeholder}
|
{type == 'date' ?
|
||||||
value={value}
|
<input
|
||||||
onChange={inputHandler}
|
placeholder={placeholder}
|
||||||
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
value={value}
|
||||||
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
onChange={inputHandler}
|
||||||
type={type}
|
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||||
id={name}
|
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
name={name}
|
type={type}
|
||||||
onInput={onInput}
|
id={name}
|
||||||
minLength={minLengthValidation()}
|
name={name}
|
||||||
maxLength={maxLengthValidation()}
|
onInput={onInput}
|
||||||
tabIndex={tabIndex}
|
min={minDate}
|
||||||
// pattern={inputPatterns()}
|
max={maxDate}
|
||||||
ref={inputRef}
|
tabIndex={tabIndex}
|
||||||
readOnly={disable}
|
// pattern={inputPatterns()}
|
||||||
onBlur={blurHandler}
|
ref={inputRef}
|
||||||
dir={direction}
|
readOnly={disable}
|
||||||
autoComplete={autoComplete}
|
onBlur={blurHandler}
|
||||||
/>
|
dir={direction}
|
||||||
|
autoComplete={autoComplete}
|
||||||
|
/>
|
||||||
|
:
|
||||||
|
<input
|
||||||
|
placeholder={placeholder}
|
||||||
|
value={value}
|
||||||
|
onChange={inputHandler}
|
||||||
|
className={`input-field placeholder:text-base text-dark-gray w-full h-full ${iconName && 'pr-6'} ${
|
||||||
|
inputBg && inputBg} tracking-wide focus:ring-0 focus:outline-none ${fieldClass}`}
|
||||||
|
type={type}
|
||||||
|
id={name}
|
||||||
|
name={name}
|
||||||
|
onInput={onInput}
|
||||||
|
minLength={minLengthValidation()}
|
||||||
|
maxLength={maxLengthValidation()}
|
||||||
|
tabIndex={tabIndex}
|
||||||
|
// pattern={inputPatterns()}
|
||||||
|
ref={inputRef}
|
||||||
|
readOnly={disable}
|
||||||
|
onBlur={blurHandler}
|
||||||
|
dir={direction}
|
||||||
|
autoComplete={autoComplete}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</>
|
||||||
{iconName && (
|
{iconName && (
|
||||||
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
<div className="absolute right-6 bottom-3 z-10 flex gap-2">
|
||||||
{iconName.split(" ").map((item, index) => (
|
{iconName.split(" ").map((item, index) => (
|
||||||
|
|||||||
@@ -76,3 +76,22 @@ export const AmountTo2DP = (
|
|||||||
// return formattedNumber;
|
// return formattedNumber;
|
||||||
return formattedNumber;
|
return formattedNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// FUNCTION TO RETURN CURRENCY SYMBOL
|
||||||
|
export const currencySymbol = (
|
||||||
|
currencyName = "naira",
|
||||||
|
amount = "00",
|
||||||
|
) => {
|
||||||
|
// Cureency Array
|
||||||
|
let currencyArray = [
|
||||||
|
{currencyName:'naira', symbol:'₦'},
|
||||||
|
{currencyName:'usd', symbol:'$'},
|
||||||
|
]
|
||||||
|
|
||||||
|
const matchedCurrency = currencyArray.filter(item => item.currencyName.toLocaleLowerCase() == currencyName.toLocaleLowerCase())
|
||||||
|
const amountTo2DP = AmountTo2DP(amount)
|
||||||
|
// return formattedNumber;
|
||||||
|
return matchedCurrency.length ? <><span>{matchedCurrency[0].symbol}</span><span>{amountTo2DP}</span></> : <><span>$</span><span>{amountTo2DP}</span></>;
|
||||||
|
};
|
||||||
@@ -7,7 +7,8 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
|||||||
|
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||||
|
|
||||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||||
|
import {NewDateTimeFormatter} from '../../lib/NewDateTimeFormatter'
|
||||||
|
|
||||||
function JobsCompleted() {
|
function JobsCompleted() {
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ function JobsCompleted() {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
|
||||||
{jobHistory?.loading ?
|
{jobHistory?.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: jobHistory?.data?.length ?
|
: jobHistory?.data?.length ?
|
||||||
@@ -71,12 +72,11 @@ function JobsCompleted() {
|
|||||||
<div className='flex flex-col'>
|
<div className='flex flex-col'>
|
||||||
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
|
<h1 className='text-lg font-bold line-clamp-1'>{item?.title}</h1>
|
||||||
<p className='text-sm line-clamp-2'>{item?.description}</p>
|
<p className='text-sm line-clamp-2'>{item?.description}</p>
|
||||||
|
<p className='text-sm line-clamp-2'>{NewDateTimeFormatter(item?.delivery_date)}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{AmountTo2DP(item?.price*0.01)} {item?.currency}</td>
|
<td className="p-4 flex text-right justify-end items-center">{currencySymbol(item?.currency_code, item?.price*0.01)}</td>
|
||||||
{/* <td className="p-4">{date}</td>
|
|
||||||
<td className="p-4">{item?.contract}</td> */}
|
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import PaginatedList from '../../components/Pagination/PaginatedList';
|
|||||||
|
|
||||||
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
import LoadingSpinner from '../Spinners/LoadingSpinner';
|
||||||
|
|
||||||
import { AmountTo2DP } from '../Helpers/PriceFormatter';
|
import { currencySymbol } from '../Helpers/PriceFormatter';
|
||||||
|
|
||||||
|
|
||||||
export const RewardsTable = memo(() => {
|
export const RewardsTable = memo(() => {
|
||||||
@@ -47,7 +47,7 @@ export const RewardsTable = memo(() => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
<div className='py-4 flex flex-col justify-between min-h-[500px] w-full overflow-x-auto'>
|
||||||
{familyRewardHistory.loading ?
|
{familyRewardHistory.loading ?
|
||||||
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
: familyRewardHistory.data.length ?
|
: familyRewardHistory.data.length ?
|
||||||
@@ -55,9 +55,9 @@ export const RewardsTable = memo(() => {
|
|||||||
<thead className='w-full'>
|
<thead className='w-full'>
|
||||||
<tr className='text-slate-600 dark:text-white'>
|
<tr className='text-slate-600 dark:text-white'>
|
||||||
<th className="p-4"></th>
|
<th className="p-4"></th>
|
||||||
<th className="p-4 text-right">Amount</th>
|
<th className="p-4 text-center">Amount</th>
|
||||||
<th className="p-4">Date</th>
|
<th className="p-4 text-center">Date</th>
|
||||||
<th className="p-4">Confirmation</th>
|
<th className="p-4 text-center">Confirmation</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -65,18 +65,18 @@ export const RewardsTable = memo(() => {
|
|||||||
let date = new Date(item.added).toLocaleDateString()
|
let date = new Date(item.added).toLocaleDateString()
|
||||||
return (
|
return (
|
||||||
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
|
<tr key={index} className='dark:text-white dark:bg-dark-white border-y dark:border-[#5356fb29] hover:bg-gray-50 dark:hover:bg-gray-50 dark:hover:text-black transition-all duration-300'>
|
||||||
<td className="p-4">
|
<td className="p-4 min-w-[300px]">
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex w-full items-center gap-2'>
|
||||||
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
<img src={item.icon} className='min-w-[60px] max-w-[60px] min-h-[60px] max-h-[60px] rounded-full bg-slate-500' alt='Reward Logo' />
|
||||||
<div className='flex flex-col'>
|
<div className='flex flex-col w-full'>
|
||||||
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
|
<h1 className='text-lg font-bold'>Reward to {item.rec_firstname} {item.rec_lastname}</h1>
|
||||||
<p className='text-sm'>{item.description}</p>
|
<p className='text-sm'>{item.description}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{AmountTo2DP(item.amount*0.01)} {item.currency}</td>
|
<td className="p-4 text-right flex-nowrap">{currencySymbol(item.currency, item.amount*0.01)}</td>
|
||||||
<td className="p-4">{date}</td>
|
<td className="p-4 text-center">{date}</td>
|
||||||
<td className="p-4">{item.confirmation}</td>
|
<td className="p-4 text-center">{item.confirmation}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export default function History() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
|
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
|
||||||
<div className="flex-1 overflow-y-auto min-h-[520px]">
|
<div className="w-full overflow-y-auto min-h-[520px]">
|
||||||
<>
|
<>
|
||||||
{/* PURCHASE SECTION */}
|
{/* PURCHASE SECTION */}
|
||||||
{selectedTab == 'purchases' &&
|
{selectedTab == 'purchases' &&
|
||||||
|
|||||||
@@ -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 userApi = new usersService();
|
const [firstTimeModal, setFirstTimeModal] = useState(true)
|
||||||
|
|
||||||
// const trending = MyActiveJobList;
|
const userApi = new usersService();
|
||||||
|
|
||||||
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
||||||
|
|
||||||
@@ -22,121 +22,98 @@ export default function FamilyDash({ MyActiveJobList=[], serverImg }) {
|
|||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
let [reloadBanner, setReloadBanner] = useState(0)
|
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
if(reloadBanner >= 2){
|
|
||||||
dispatch(tableReload({ type: "FAMILYBANNERSLIST" })); // RELOAD FAMILY BANNERS LIST EVERY 10 MINS
|
|
||||||
setReloadBanner(0)
|
|
||||||
}
|
|
||||||
const timer = setInterval(()=>{
|
|
||||||
setReloadBanner(prev => prev+1)
|
|
||||||
},300000)
|
|
||||||
|
|
||||||
return ()=>{
|
|
||||||
clearInterval(timer)
|
|
||||||
}
|
|
||||||
},[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-xl font-normal leading-5">Welcome</p>
|
||||||
<h1 className="text-lg font-normal leading-5">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
<div className="">
|
||||||
|
<h1 className="text-xl font-normal leading-5">{`${userDetails?.firstname} ${userDetails?.lastname}`}</h1>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="py-1 w-full text-base 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-xl 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-base 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-xl 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>
|
}
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
{/* {familyOffers?.result_list && familyOffers?.result_list.length > 0 && (
|
|
||||||
<MyOffersFamilyTable
|
|
||||||
familyOffers={familyOffers?.result_list}
|
|
||||||
image_server={familyOffers?.session_image_server}
|
|
||||||
className="mb-10"
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{/* {trending && trending.length > 0 && (
|
|
||||||
<FamilyActiveLSlde
|
|
||||||
trending={trending}
|
|
||||||
className="mb-10"
|
|
||||||
image_server={serverImg}
|
|
||||||
/>
|
|
||||||
)} */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
{/* last_login */}
|
||||||
|
|
||||||
|
{(!familyBannersList?.loading && firstTimeModal) &&
|
||||||
|
<HomeModal userDetails={userDetails} action={()=>setFirstTimeModal(prev => !prev)} situation={firstTimeModal} />
|
||||||
|
}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,15 +61,14 @@ export default function FullAccountDash(props) {
|
|||||||
<AccountDashboard className="mb-4" bannerList={props.bannerList} offersList={props.offersList} imageServer={props.imageServer} />
|
<AccountDashboard className="mb-4" bannerList={props.bannerList} offersList={props.offersList} imageServer={props.imageServer} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{
|
{/* {props?.dashTypes !== "undefined" &&
|
||||||
// props?.dashTypes !== "undefined" &&
|
props.offersList?.data?.result_list?.length ? (
|
||||||
// props.offersList?.data?.result_list?.length ? (
|
<MyOffersTable
|
||||||
// <MyOffersTable
|
MyActiveOffersList={props.offersList?.data}
|
||||||
// MyActiveOffersList={props.offersList?.data}
|
className="mb-10"
|
||||||
// className="mb-10"
|
/>
|
||||||
// />
|
)
|
||||||
// )
|
:
|
||||||
// :
|
|
||||||
props.MyActiveJobList?.data?.length ? (
|
props.MyActiveJobList?.data?.length ? (
|
||||||
<>
|
<>
|
||||||
<div className="w-full mb-5 flex justify-between items-center gap-1">
|
<div className="w-full mb-5 flex justify-between items-center gap-1">
|
||||||
@@ -83,7 +82,7 @@ export default function FullAccountDash(props) {
|
|||||||
imageServer={props.offersList?.data?.session_image_server}
|
imageServer={props.offersList?.data?.session_image_server}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null} */}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ export default function HomeActivities({ className }) {
|
|||||||
getRecentActivities();
|
getRecentActivities();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log(recentActivitiesData);
|
// console.log(recentActivitiesData);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
|
className={`update-table w-full bg-white dark:bg-dark-white overflow-hidden rounded-2xl relative min-h-[520px] ${
|
||||||
className || ""
|
className || ""
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,94 +1,56 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
import {Navigate} from 'react-router-dom'
|
||||||
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>
|
||||||
|
<Navigate to='/login' />
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import React, {useState, useEffect} from "react";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
|
||||||
|
import TabButton from "../customTabs/TabButton";
|
||||||
|
|
||||||
|
export default function LearnMore() {
|
||||||
|
|
||||||
|
const apiCall = new usersService()
|
||||||
|
|
||||||
|
const [selectedTab, setSelectedTab] = useState("topic 1");
|
||||||
|
|
||||||
|
const [tabs, setTabs] = useState(
|
||||||
|
[ //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: "topic 1",
|
||||||
|
iconName: "history",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: "topic 2",
|
||||||
|
iconName: "history",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
title: "topic 3",
|
||||||
|
iconName: "history",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
title: "topic 4",
|
||||||
|
iconName: "history",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
// const tabs = [ //STATE FOR SWITCHING BETWEEN TABS
|
||||||
|
// {
|
||||||
|
// id: 1,
|
||||||
|
// title: "topic 1",
|
||||||
|
// iconName: "history",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: 2,
|
||||||
|
// title: "topic 2",
|
||||||
|
// iconName: "history",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: 3,
|
||||||
|
// title: "topic 3",
|
||||||
|
// iconName: "history",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: 4,
|
||||||
|
// title: "topic 4",
|
||||||
|
// iconName: "history",
|
||||||
|
// },
|
||||||
|
// ]
|
||||||
|
|
||||||
|
let [topics, setTopics] = useState({ // FOR PAYMENT HISTORY
|
||||||
|
loading: true,
|
||||||
|
data: [],
|
||||||
|
})
|
||||||
|
|
||||||
|
//FUNCTION TO GET LEARN MORE TOPIC
|
||||||
|
useEffect(()=>{
|
||||||
|
apiCall.getLearnmoreTopics().then((res)=>{
|
||||||
|
if(res.data.internal_return < 0){ // success but no data
|
||||||
|
setTopics(prev => ({...prev, loading: false}))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const resData = res?.data?.result_list || []
|
||||||
|
console.log('resData', resData)
|
||||||
|
setTopics(prev => ({...prev, loading: false, data: resData}))
|
||||||
|
setTabs(prev => {
|
||||||
|
return prev?.map((item, index) => ({...item, title:resData[index]?.topic}))
|
||||||
|
})
|
||||||
|
setSelectedTab(resData[0].topic)
|
||||||
|
// console.log('RES', resData)
|
||||||
|
}).catch((error)=>{
|
||||||
|
setTopics(prev => ({...prev, loading: false}))
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Layout>
|
||||||
|
<div className="history-wrapper w-full mb-10">
|
||||||
|
<div className="w-full">
|
||||||
|
<div className="sm:flex justify-between items-center mb-6">
|
||||||
|
<div className="mb-5 sm:mb-0">
|
||||||
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
|
|
||||||
|
Learn More
|
||||||
|
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<div className="slider-btns flex space-x-4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-full h-full p-4 bg-white dark:bg-dark-white rounded-2xl section-shadow lg:flex lg:px-10 px-4 justify-between">
|
||||||
|
<div className="content-tab-items lg:w-[230px] w-full mr-2">
|
||||||
|
<div className='overflow-hidden mb-5 lg:mb-0 py-2 lg:py-8'>
|
||||||
|
{(!topics.loading && topics?.data?.length > 0) && tabs.map((item) => (
|
||||||
|
<div key={item.id} className='w-full'>
|
||||||
|
<TabButton
|
||||||
|
key={item.id}
|
||||||
|
item={item.title}
|
||||||
|
iconName={item.iconName}
|
||||||
|
selectedTab={selectedTab}
|
||||||
|
setSelectedTab={setSelectedTab}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-[1px] bg-[#E3E4FE] dark:bg-[#a7a9b533] mr-10"></div>
|
||||||
|
<div className="flex-1 overflow-y-auto min-h-[520px]">
|
||||||
|
<>
|
||||||
|
{/* TOPICS SECTION */}
|
||||||
|
<div className="w-full py-2 lg:py-8">
|
||||||
|
{topics.loading ?
|
||||||
|
<LoadingSpinner size='16' color='sky-blue' height='h-[500px]' />
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
{(topics?.data && topics?.data?.length > 0) ?
|
||||||
|
<div dangerouslySetInnerHTML={{
|
||||||
|
__html: topics?.data?.filter(item => item?.topic == selectedTab)[0]?.contents,
|
||||||
|
}} className='prose dark:text-white dark:bg-dark-white'
|
||||||
|
>
|
||||||
|
{/* {topics?.data?.filter(item => item.topic == selectedTab)[0]?.contents} */}
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<p className='p-2 text-slate-500 flex flex-col grow justify-center items-center'>No Topics found</p>}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
{/* END OF TOPICS SECTION */}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import {PriceFormatter} from '../../Helpers/PriceFormatter'
|
||||||
|
|
||||||
export default function LockJob({
|
export default function LockJob({
|
||||||
details,
|
details,
|
||||||
@@ -40,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) => {
|
||||||
@@ -56,6 +57,7 @@ export default function LockJob({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
<div className='md:grid md:grid-cols-4'>
|
||||||
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
|
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
|
||||||
<div className="min-h-[200px]">
|
<div className="min-h-[200px]">
|
||||||
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
||||||
@@ -276,6 +278,7 @@ export default function LockJob({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -133,11 +133,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
// let addedIntDate = marketInt?.added?.split(" ")[0];
|
// let addedIntDate = marketInt?.added?.split(" ")[0];
|
||||||
// let expireIntDate = marketInt?.expire?.split(" ")[0];
|
// let expireIntDate = marketInt?.expire?.split(" ")[0];
|
||||||
|
|
||||||
let cleanedText = details?.job_description
|
let cleanedText = details?.job_description?.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/&/g, "&");
|
||||||
?.replace(/</g, "<")
|
|
||||||
.replace(/>/g, ">")
|
|
||||||
.replace(/"/g, '"')
|
|
||||||
.replace(/&/g, "&");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
@@ -149,7 +145,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
<CloseIcon onClose={onClose} />
|
<CloseIcon onClose={onClose} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="md:grid md:grid-cols-4 bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg">
|
<div className="bg-white dark:bg-dark-white text-slate-900 dark:text-white rounded-lg">
|
||||||
{details?.offer_depend_uid ?
|
{details?.offer_depend_uid ?
|
||||||
<LockJob
|
<LockJob
|
||||||
marketPlaceProduct={marketPlaceProduct}
|
marketPlaceProduct={marketPlaceProduct}
|
||||||
@@ -164,7 +160,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
<div className="px-4 py-2 w-full md:col-span-3 md:border-r-1">
|
<div className="px-4 py-2 w-full">
|
||||||
<div className="min-h-[300px]">
|
<div className="min-h-[300px]">
|
||||||
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
<h2 className="w-full flex gap-1 items-center font-semibold text-slate-900 dark:text-white tracking-wide">
|
||||||
{details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
|
{details?.offer_depend_uid && <i className="fa-solid fa-lock p-1 text-red-500 text-[12px]"></i>}
|
||||||
@@ -190,15 +186,15 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
danger: true,
|
danger: true,
|
||||||
},
|
},
|
||||||
].map(({ name, content, danger }, idx) => (
|
].map(({ name, content, danger }, idx) => (
|
||||||
<div className={`my-3 md:flex items-start`} key={idx}>
|
<div className={`my-3 flex-col gap-1`} key={idx}>
|
||||||
<label className="py-2 job-label w-full md:w-[19%]">
|
<label className="py-2 job-label w-full md:w-[19%]">
|
||||||
{name}
|
{name}
|
||||||
</label>
|
</label>
|
||||||
<div
|
<div
|
||||||
className={`w-full p-2 md:w-3/4 text-slate-900 dark:text-white market-pop rounded-2xl ${
|
className={`w-full p-2 text-slate-900 dark:text-white market-pop rounded-2xl ${
|
||||||
name == "Description"
|
name == "Description"
|
||||||
? "min-h-[150px] max-h-[150px] h-full overflow-y-auto break-words bg-slate-50"
|
? "min-h-[60px] max-h-[75px] h-full overflow-y-auto break-words bg-slate-50"
|
||||||
: name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[150px] max-h-[150px] bg-slate-50"
|
: name == "Delivery Detail" ? " overflow-y-auto h-full min-h-[200px] max-h-[200px] bg-slate-50"
|
||||||
: "h-full flex items-center"
|
: "h-full flex items-center"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -237,122 +233,111 @@ const MarketPopUp = ({ details, onClose, situation, marketInt, marketPlaceProduc
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<hr className='my-1' />
|
<hr className='my-1' />
|
||||||
<div className='w-full'>
|
<div className='w-full grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-8 items-center'>
|
||||||
<label className="job-label w-full flex gap-2 items-center">
|
<div className='col-span-1 md:col-span-2 flex flex-col justify-center gap-2'>
|
||||||
If you have any questions about this task:
|
<label className="job-label w-full flex gap-2 items-center">
|
||||||
<span className={`text-sm ${marketMsg.state ? 'text-[#57cd89]' : 'text-red-500'}`}>
|
If you have any questions about this task:
|
||||||
{marketMsg.state && "Message Sent!"}
|
<span className={`text-sm ${marketMsg.state ? 'text-[#57cd89]' : 'text-red-500'}`}>
|
||||||
{errMsg.market && "Failed to send"}
|
{marketMsg.state && "Message Sent!"}
|
||||||
</span>
|
{errMsg.market && "Failed to send"}
|
||||||
</label>
|
</span>
|
||||||
<div className="w-full flex items-center gap-3">
|
</label>
|
||||||
<div className="w-full">
|
<div className="w-full flex items-center gap-3">
|
||||||
<textarea
|
<div className="w-full">
|
||||||
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
|
<textarea
|
||||||
marketMsg.loading && "italic text-[#9CA3AF]"
|
className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
|
||||||
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
|
marketMsg.loading && "italic text-[#9CA3AF]"
|
||||||
rows="3"
|
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
|
||||||
style={{ resize: "none" }}
|
rows="3"
|
||||||
placeholder="Enter message here ..."
|
style={{ resize: "none" }}
|
||||||
value={marketMsg.loading ? "Sending..." : textValue}
|
placeholder="Enter message here ..."
|
||||||
onChange={handleInputChange}
|
value={marketMsg.loading ? "Sending..." : textValue}
|
||||||
/>
|
onChange={handleInputChange}
|
||||||
</div>
|
/>
|
||||||
<div className="relative flex flex-col">
|
</div>
|
||||||
<button
|
<div className="relative flex flex-col">
|
||||||
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
|
<button
|
||||||
name="market-message"
|
className="rounded-full flex justify-center items-center w-12 h-11 bg-yellow-500 text-white"
|
||||||
onClick={MarketDetail}
|
name="market-message"
|
||||||
disabled={marketMsg.loading}
|
onClick={MarketDetail}
|
||||||
>
|
disabled={marketMsg.loading}
|
||||||
{marketMsg.loading ? (
|
|
||||||
<LoadingSpinner size={5} color="white" />
|
|
||||||
) : (
|
|
||||||
// "Send Message"
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 11 20"
|
|
||||||
id="Arrow"
|
|
||||||
className="w-[0.7rem]"
|
|
||||||
>
|
>
|
||||||
<path
|
{marketMsg.loading ? (
|
||||||
fillRule="evenodd"
|
<LoadingSpinner size={5} color="white" />
|
||||||
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
) : (
|
||||||
// fill=""
|
// "Send Message"
|
||||||
className="color000000 svgShape fill-[#fff]"
|
<svg
|
||||||
></path>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
</svg>
|
viewBox="0 0 11 20"
|
||||||
)}
|
id="Arrow"
|
||||||
</button>
|
className="w-[0.7rem]"
|
||||||
{/* <span className="text-sm text-[#57cd89]">
|
>
|
||||||
{marketMsg.state && "Sent!"}
|
<path
|
||||||
{errMsg.market && "Failed"}
|
fillRule="evenodd"
|
||||||
</span> */}
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="py-2 w-full md:col-span-1 h-full flex flex-col rounded-2xl">
|
<div className="span-1 flex flex-col justify-center mb-4 gap-2">
|
||||||
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md w-full h-full md:min-h-[420px] flex flex-col justify-between">
|
<p className="flex items-center tracking-wide">
|
||||||
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
<span className="job-label">Interest Count: </span> <b className="ml-1">{interestCount.length > 0 ? interestCount[0].interest_count : '0'}</b>
|
||||||
<p className="job-label w-full">
|
|
||||||
Interested?
|
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
{/* <hr /> */}
|
||||||
<button
|
<button
|
||||||
className="btn-gradient text-white px-2 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
|
className="btn-gradient text-white p-1 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl"
|
||||||
name="market-interest"
|
name="market-interest"
|
||||||
onClick={ManageInterest}
|
onClick={ManageInterest}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
<div className="flex md:flex-col justify-center gap-2">
|
<div className="flex md:flex-col justify-center gap-2">
|
||||||
<span>Notify</span>
|
<span>I am Interested</span>
|
||||||
<span>Owner</span>
|
{/* <span>Owner</span> */}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<>
|
|
||||||
{manageInt.loading ? (
|
|
||||||
<p className="text-sm italic">please wait...</p>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{manageInt?.msg !== "" && (
|
|
||||||
<p
|
|
||||||
className={`text-sm italic ${
|
|
||||||
manageInt?.state ? "text-green-500" : "text-red-500"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{manageInt?.msg}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-slate-900">
|
|
||||||
<p className="flex items-center tracking-wide">
|
|
||||||
<span className="job-label">Interest: </span> <b className="ml-1">{interestCount.length > 0 ? interestCount[0].interest_count : '0'}</b>
|
|
||||||
</p>
|
|
||||||
<hr />
|
|
||||||
<p className="my-1 flex flex-col">
|
|
||||||
<span className="job-label">Expire: </span>
|
|
||||||
<span> {new Date(details.expire).toLocaleString()} </span>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
{manageInt.loading ? (
|
||||||
|
<p className="text-sm italic">please wait...</p>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{manageInt?.msg !== "" && (
|
||||||
|
<p
|
||||||
|
className={`text-sm italic ${
|
||||||
|
manageInt?.state ? "text-green-500" : "text-red-500"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{manageInt?.msg}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="modal-footer-wrapper">
|
<div className="modal-footer-wrapper flex justify-between gap-2 items-center">
|
||||||
|
<div className="text-slate-900">
|
||||||
|
<p className="my-1 flex flex-col">
|
||||||
|
<span className="job-label">Expire: </span>
|
||||||
|
<span> {new Date(details.expire).toLocaleString()} </span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
className="custom-btn bg-transparent border border-red-500 text-red-500 ml-auto"
|
className="custom-btn bg-transparent border border-red-500 text-red-500 ml-auto"
|
||||||
name="cancel"
|
name="cancel"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
Cancel
|
Close
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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 (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col justify-between'>
|
<div className="w-full h-full max-h-[343px] overflow-y-auto">
|
||||||
<div className="w-full h-full min-h-[250px] max-h-[300px] overflow-y-auto">
|
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='border-b-2'>
|
<thead className='border-b-2'>
|
||||||
<tr className='text-slate-600'>
|
<tr className='text-slate-600'>
|
||||||
@@ -71,9 +70,10 @@ export default function ActiveJobMessage({ activeJobMesList }) {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* PAGINATION BUTTON */}
|
// <div className='flex flex-col justify-between'>
|
||||||
{/* <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} /> */}
|
// PAGINATION BUTTON
|
||||||
{/* END OF PAGINATION BUTTON */}
|
// <PaginatedList onClick={handlePagination} prev={currentPage == 0 ? true : false} next={currentPage+Number(process.env.REACT_APP_ITEM_PER_PAGE) >= activeJobMesList?.data?.length ? true : false} data={activeJobMesList?.data} start={indexOfFirstItem} stop={indexOfLastItem} />
|
||||||
</div>
|
// END OF PAGINATION BUTTON
|
||||||
|
// </div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import IndexJobActions from "./JobActions/IndexJobActions";
|
|||||||
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 ManageJobTab from "../customTabs/ManageJobTab";
|
||||||
import AttachFile from "../attachmentCom/AttachFile";
|
import AttachFile from "../attachmentCom/AttachFile";
|
||||||
|
|
||||||
import JobDetailPopout from "./JobDetailPopout";
|
import JobDetailPopout from "./JobDetailPopout";
|
||||||
@@ -390,8 +390,8 @@ function ActiveJobs(props) {
|
|||||||
{/* end of job details */}
|
{/* end of job details */}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md lg:flex justify-between items-start space-y-4 lg:space-x-4 lg:space-y-0">
|
<div className="my-4 py-[20px] bg-white dark:bg-black px-4 rounded-2xl shadow-md grid grid-cols-1 lg:grid-cols-2 gap-3">
|
||||||
<div className="w-full lg:w-1/2 mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
<div className="w-full mb-4 border-b pb-4 lg:pb-0 lg:mb-0 lg:border-b-0">
|
||||||
<div className="">
|
<div className="">
|
||||||
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="text-lg font-bold text-dark-gray dark:text-white tracking-wide">
|
||||||
Actions
|
Actions
|
||||||
@@ -408,7 +408,7 @@ function ActiveJobs(props) {
|
|||||||
{/* switch button */}
|
{/* switch button */}
|
||||||
<div className="grid grid-cols-2">
|
<div className="grid grid-cols-2">
|
||||||
{tabs.map((item) => (
|
{tabs.map((item) => (
|
||||||
<TabButton
|
<ManageJobTab
|
||||||
key={item}
|
key={item}
|
||||||
item={item}
|
item={item}
|
||||||
selectedTab={selectedTab}
|
selectedTab={selectedTab}
|
||||||
@@ -545,14 +545,16 @@ function ActiveJobs(props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* MESSAGE SECTION */}
|
{/* MESSAGE SECTION */}
|
||||||
<div className="w-full lg:w-1/2">
|
<div className="w-full flex flex-col">
|
||||||
<div className="mb-4">
|
{props.details &&
|
||||||
<AttachFile
|
<div className="mb-4">
|
||||||
data={props.details}
|
<AttachFile
|
||||||
showOnData={true}
|
data={props.details}
|
||||||
fontSize={'text-lg'}
|
showOnData={true}
|
||||||
/>
|
fontSize={'text-lg'}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className="flex justify-between items-center gap-5">
|
<div className="flex justify-between items-center gap-5">
|
||||||
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
<p className="w-full text-lg font-bold text-dark-gray dark:text-white tracking-wide flex items-center gap-2 justify-between">
|
||||||
<span>Message</span>
|
<span>Message</span>
|
||||||
@@ -671,37 +673,46 @@ const PopModal = ({
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
<div className="job-action-modal-body w-full px-10 py-2 gap-4">
|
||||||
<div className="w-full flex flex-col items-center">
|
<div className="w-full">
|
||||||
{activeJobMesList.loading ? (
|
{activeJobMesList.loading ? (
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
<div className="message-table h-[500px] overflow-y-auto">
|
<div className="message-table h-[500px] overflow-y-auto">
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className="border-b-2">
|
{/* <thead className="border-b-0">
|
||||||
<tr className="text-slate-600">
|
<tr className="text-slate-600">
|
||||||
<th className="p-2"></th>
|
<th className="p-0"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead> */}
|
||||||
{activeJobMesList?.data?.length ? (
|
{activeJobMesList?.data?.length ? (
|
||||||
<tbody>
|
<tbody>
|
||||||
{activeJobMesList?.data?.map((item, index) => (
|
{activeJobMesList?.data?.map((item, index) => {
|
||||||
|
let imageLink = `${activeJobMesList?.image}${localStorage.getItem('session_token')}/contracts/${item.msg_uid}`
|
||||||
|
|
||||||
|
return (
|
||||||
<tr key={index} className="text-slate-500">
|
<tr key={index} className="text-slate-500">
|
||||||
<td>
|
<td>
|
||||||
<div className="msg_box">
|
<div className={`msg_box ${item.who}`}>
|
||||||
<div className="msg_header">
|
<div className="msg_header">
|
||||||
{item.msg_date} {item.msg_firstname}
|
{item.msg_date} {item.msg_firstname}
|
||||||
</div>
|
</div>
|
||||||
<span
|
{/* <span
|
||||||
className="p-2"
|
className="p-2"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: item.message,
|
__html: item.message,
|
||||||
}}
|
}}
|
||||||
></span>
|
></span> */}
|
||||||
|
{item.msg_type == 'FILE' ?
|
||||||
|
<a href={imageLink} target="_blank" className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></a>
|
||||||
|
:
|
||||||
|
<span className="p-2" dangerouslySetInnerHTML={{__html: item.message}}></span>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
) : activeJobMesList.error ? (
|
) : activeJobMesList.error ? (
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,14 @@ import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
|||||||
|
|
||||||
import usersService from '../../../services/UsersService'
|
import usersService from '../../../services/UsersService'
|
||||||
|
|
||||||
|
import {NewDateTimeFormatter }from '../../../lib/NewDateTimeFormatter'
|
||||||
|
|
||||||
function CurrentTaskAction({jobDetails}) {
|
function CurrentTaskAction({jobDetails}) {
|
||||||
|
|
||||||
|
const currTime = new Date().getTime() / (1000*60*60)
|
||||||
|
const minDueTime = new Date(jobDetails?.minimum_due).getTime() / (1000*60*60)
|
||||||
|
const canSendForReview = Number(jobDetails.strict_timeline) ? currTime >= minDueTime : true // calculation to determine when send for review button will be active
|
||||||
|
|
||||||
const apiCall = new usersService()
|
const apiCall = new usersService()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
@@ -65,7 +71,7 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
<div className="h-full w-full text-sm text-left text-gray-500">
|
<div className="h-full w-full text-sm text-left text-gray-500">
|
||||||
{jobDetails.job_type == 'MEDIA' ?
|
{jobDetails.job_type == 'MEDIA' ?
|
||||||
<div className="h-full flex justify-center items-center">
|
<div className="h-full flex justify-center items-center">
|
||||||
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white p-1 lg:p-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
<button onClick={popUpHandler} type="button" className="btn-gradient h-full text-white px-5 py-2 border-4 border-slate-300 text-lg lg:text-xl font-medium rounded-2xl">
|
||||||
I have completed this task
|
I have completed this task
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +84,7 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient text-white">
|
<button onClick={popUpHandler} type="button" className="custom-btn btn-gradient px-5 py-2 text-white">
|
||||||
Send for Review
|
Send for Review
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -120,36 +126,57 @@ function CurrentTaskAction({jobDetails}) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
<div className="job-action-modal-body w-full px-10 py-8 gap-4">
|
||||||
<div className="w-full flex flex-col items-center">
|
<div className="w-full flex flex-col min-h-[150px] gap-8 items-center">
|
||||||
<div className="mb-10 flex justify-center items-center gap-2">
|
{!canSendForReview ?
|
||||||
<input
|
<>
|
||||||
type='checkbox'
|
<h1
|
||||||
checked={checked}
|
// className='font-bold text-base tracking-wide text-dark-gray dark:text-white'
|
||||||
onChange={()=>{setChecked(prev => !prev)}}
|
className='font-bold text-xl tracking-wide text-red-500 text-center'
|
||||||
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
|
|
||||||
/>
|
|
||||||
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mb-10 flex justify-center items-center">
|
|
||||||
{reqStatus.loading ?
|
|
||||||
<LoadingSpinner color='sky-blue' size='10' />
|
|
||||||
:
|
|
||||||
<button type="button" onClick={taskCompletedSubmit} className="px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
|
||||||
Send for Review & Acceptance
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
|
||||||
<div className="w-full">
|
|
||||||
<div
|
|
||||||
className={`relative p-4 text-center text-md font-light leading-[19.5px] text-[13px] ${reqStatus.status ? 'text-green-700':'text-[#912741]'}`}
|
|
||||||
>
|
>
|
||||||
{reqStatus.message}
|
This task can be marked completed after {NewDateTimeFormatter(jobDetails?.minimum_due)}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<div className="flex justify-center items-center gap-2">
|
||||||
|
<input
|
||||||
|
type='checkbox'
|
||||||
|
checked={checked}
|
||||||
|
onChange={()=>{setChecked(prev => !prev)}}
|
||||||
|
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
|
||||||
|
/>
|
||||||
|
<p className='font-bold text-base tracking-wide text-dark-gray dark:text-white'>If you have completed this task</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
<div className="flex justify-center items-center">
|
||||||
|
{reqStatus.loading ?
|
||||||
|
<LoadingSpinner color='sky-blue' size='10' />
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={taskCompletedSubmit}
|
||||||
|
className={`px-2 py-1 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white ${!canSendForReview && 'pointer-events-none opacity-50'}`}
|
||||||
|
>
|
||||||
|
Send for Review & Acceptance
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||||
|
{reqStatus.message &&
|
||||||
|
<div className="w-full">
|
||||||
|
<div
|
||||||
|
className={`relative p-4 text-center text-md font-light leading-[19.5px] text-[13px] ${reqStatus.status ? 'text-green-700':'text-[#912741]'}`}
|
||||||
|
>
|
||||||
|
{reqStatus.message}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||||
|
|
||||||
|
</>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* cancel btn */}
|
{/* cancel btn */}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function PastDueJobAction({jobDetails}) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={popUpHandler}
|
onClick={popUpHandler}
|
||||||
className="custom-btn btn-gradient text-base text-white"
|
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
|
||||||
>
|
>
|
||||||
Cancel or Extend Timeline
|
Cancel or Extend Timeline
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,26 +1,136 @@
|
|||||||
import React from 'react'
|
import React,{useState} from 'react'
|
||||||
|
import ModalCom from '../../Helpers/ModalCom'
|
||||||
|
import LoadingSpinner from '../../Spinners/LoadingSpinner'
|
||||||
|
import { useNavigate } from 'react-router-dom'
|
||||||
|
import usersService from '../../../services/UsersService'
|
||||||
|
|
||||||
|
function PastDueTaskAction({jobDetails}) {
|
||||||
|
|
||||||
|
const apiCall = new usersService()
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const [checked, setChecked] = useState(false)
|
||||||
|
|
||||||
|
const [extendedTime, setExtendedTime] = useState('') // VALUE OF NEW EXTENDED TIME
|
||||||
|
|
||||||
|
const [action, setAction] = useState('') // VALUE OF NEW EXTENDED TIME
|
||||||
|
|
||||||
|
const [reqStatus, setReqStatus] = useState({loading:false, status: false, message: ''})
|
||||||
|
|
||||||
|
let [popUp, setPopUp] = useState(false)
|
||||||
|
|
||||||
|
const popUpHandler = () => {
|
||||||
|
if(popUp){
|
||||||
|
setChecked(false)
|
||||||
|
}
|
||||||
|
setPopUp(prev => !prev)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO HANDLE WHEN OWNER CANCELS JOB
|
||||||
|
const cancelTask = () => {
|
||||||
|
setAction('cancel')
|
||||||
|
setReqStatus({loading:true, status: false, message: ''})
|
||||||
|
|
||||||
|
let reqData = { // API PAYLOADS
|
||||||
|
contract: jobDetails.contract,
|
||||||
|
contract_uid: jobDetails.contract_uid,
|
||||||
|
job_action: 'CANCEL_CONTRACT',
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!checked){ // CHECKS IF CHECKBOX IS SELECTED
|
||||||
|
setReqStatus({loading:false, status: false, message: 'Please check the box above'})
|
||||||
|
return setTimeout(()=>{
|
||||||
|
setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
// API CALL TO ACCEPT COMPLETION BY OWNER
|
||||||
|
setReqStatus({loading:false, status: false, message: 'No api added yet'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
},1000)
|
||||||
|
// apiCall.ownerJobAction(reqData).then((res)=>{
|
||||||
|
// if(res.status != 200 || res.data.internal_return < 0){
|
||||||
|
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// setReqStatus({loading:false, status: true, message: 'job cancelled successfully'})
|
||||||
|
// setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
|
||||||
|
// popUpHandler()
|
||||||
|
// navigate('/my-pastdue-jobs', {replace: true})
|
||||||
|
// }, 3000)
|
||||||
|
// }).catch(err => {
|
||||||
|
// setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
|
||||||
|
// }).finally(()=>{
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
// }, 3000)
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION TO HANDLE WHEN USER/OWNER CLICKS ON EXTEND TIMELINE FOR A JOB
|
||||||
|
const extendTime = () => {
|
||||||
|
setAction('extend')
|
||||||
|
setReqStatus({loading:true, status: false, message: ''}) // Sets loading spinner active
|
||||||
|
let reqData = {
|
||||||
|
contract: jobDetails.contract,
|
||||||
|
contract_uid: jobDetails.contract_uid,
|
||||||
|
job_action: 'EXTEND_TIMELINE',
|
||||||
|
extension: Number(extendedTime)
|
||||||
|
}
|
||||||
|
if(!extendedTime){ // checks that timeline duration is selected
|
||||||
|
setReqStatus({loading:false, status: false, message: 'Please select timeline duration'})
|
||||||
|
return setTimeout(()=>{
|
||||||
|
setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
|
||||||
|
// API CALL EXTEND TIMELINE BY OWNER
|
||||||
|
setReqStatus({loading:false, status: false, message: 'No api added yet'})
|
||||||
|
setTimeout(()=>{
|
||||||
|
setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
},1000)
|
||||||
|
// apiCall.ownerJobAction(reqData).then((res)=>{
|
||||||
|
// if(res.status != 200 || res.data.internal_return < 0){
|
||||||
|
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// setReqStatus({loading:false, status: true, message: 'Timeline extended successfully'})
|
||||||
|
// setTimeout(()=>{ // Sets popout to false and navigates user to /my-pastdue-jobs after 3 seconds
|
||||||
|
// popUpHandler()
|
||||||
|
// navigate('/my-pastdue-jobs', {replace: true})
|
||||||
|
// }, 3000)
|
||||||
|
// }).catch(err => {
|
||||||
|
// setReqStatus({loading:false, status: false, message: 'Opps! Network error. Try again'})
|
||||||
|
// }).finally(()=>{
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// setReqStatus({loading:false, status: false, message: ''})
|
||||||
|
// }, 3000)
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
|
||||||
function PastDueTaskAction() {
|
|
||||||
return (
|
return (
|
||||||
<div className='job-action dark:bg-black'>
|
<div className='job-action dark:bg-black'>
|
||||||
|
|
||||||
<table className="w-full text-sm text-left text-gray-500 worker-pastdue">
|
<table className="w-full text-sm text-left text-gray-500 owner-pastdue">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex space-x-2 items-center w-full task_action_panel">
|
<div className="flex space-x-2 items-center w-full task_action_panel">
|
||||||
|
|
||||||
<div>
|
<div className="dark:text-red-700">
|
||||||
You have missed the allocated time
|
You have missed the allocated time
|
||||||
</div>
|
</div>
|
||||||
{/*<div className="flex flex-col flex-[0.9]"> </div>*/}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
<button type="button" className="w-[150px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white">
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={popUpHandler}
|
||||||
|
className="custom-btn btn-gradient px-5 py-2 text-base text-white"
|
||||||
|
>
|
||||||
Request Extension
|
Request Extension
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,6 +138,124 @@ function PastDueTaskAction() {
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{popUp && (
|
||||||
|
<ModalCom action={popUpHandler} situation={popUp}>
|
||||||
|
<div className="logout-modal-wrapper lg:w-[460px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<div className="modal-header-con">
|
||||||
|
<h1 className="modal-title">
|
||||||
|
Past Due Task
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="modal-close-btn"
|
||||||
|
onClick={popUpHandler}
|
||||||
|
>
|
||||||
|
<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="relative job-action-modal-body w-full px-10 py-8 gap-4">
|
||||||
|
<div className="w-full flex flex-col items-center">
|
||||||
|
<div className="mb-5 flex justify-center items-center gap-2">
|
||||||
|
<input
|
||||||
|
type='checkbox'
|
||||||
|
checked={checked}
|
||||||
|
onChange={()=>{setChecked(prev => !prev)}}
|
||||||
|
className='w-6 h-6 text-sky-blue bg-gray-100 focus:ring-sky-blue'
|
||||||
|
/>
|
||||||
|
<p className='job-label'>I am ready to cancel this task</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mb-5 w-full flex justify-end items-center">
|
||||||
|
{reqStatus.loading && action=='cancel'?
|
||||||
|
<LoadingSpinner color='sky-blue' size='10' />
|
||||||
|
:
|
||||||
|
<button disabled={reqStatus.loading} onClick={cancelTask} type="button" className="custom-btn border-gradient text-base text-white">
|
||||||
|
<span className='text-gradient'>Cancel this task</span>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* EXTEND TIMELINE SECTION */}
|
||||||
|
<div className='w-full my-3 py-3 border-t flex flex-col items-center'>
|
||||||
|
<div className='mb-5 flex items-center gap-2'>
|
||||||
|
<p className='job-label'>Extend the timeline by:</p>
|
||||||
|
<select
|
||||||
|
onChange={({target})=>{setExtendedTime(target.value)}}
|
||||||
|
className='text-base p-2 text-dark-gray dark:text-white border border-slate-300 outline-0 rounded-full'
|
||||||
|
>
|
||||||
|
<option className='text-slate-500 text-lg' value=''>select</option>
|
||||||
|
<option className='text-slate-500 text-lg' value='2'>1 days</option>
|
||||||
|
<option className='text-slate-500 text-lg' value='3'>3 days</option>
|
||||||
|
<option className='text-slate-500 text-lg' value='5'>5 days</option>
|
||||||
|
<option className='text-slate-500 text-lg' value='7'>1 week</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{reqStatus.loading && action=='extend' ?
|
||||||
|
<LoadingSpinner color='sky-blue' size='10' />
|
||||||
|
:
|
||||||
|
<div className='w-full flex justify-end items-center'>
|
||||||
|
<button disabled={reqStatus.loading} type="button" onClick={extendTime} className="custom-btn btn-gradient text-base text-white">
|
||||||
|
Request Extension
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||||
|
<div className="w-full absolute left-0 bottom-0 text-center">
|
||||||
|
{reqStatus.message != "" &&
|
||||||
|
(!reqStatus.status ? (
|
||||||
|
<div
|
||||||
|
className={`relative p-2 mx-2 text-[#912741] bg-[#fcd9e2] border-[#fbc6d3] mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{reqStatus.message}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
reqStatus.status && (
|
||||||
|
<div
|
||||||
|
className={`relative p-2 mx-2 text-green-700 bg-slate-200 border-slate-800 mb-4 rounded-[0.475rem] text-md font-light leading-[19.5px] text-[13px]`}
|
||||||
|
>
|
||||||
|
{reqStatus.message}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{/* END OF FOR SUCCESS/ERROR DISPLAY SECTION*/}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/* cancel btn */}
|
||||||
|
<div className='modal-footer-wrapper flex justify-center items-center'>
|
||||||
|
<button onClick={popUpHandler} type="button"
|
||||||
|
// className="w-20 h-11 flex justify-center items-center border-gradient text-base rounded-full text-white"
|
||||||
|
className='custom-btn text-base bg-transparent border border-red-500 text-red-500'
|
||||||
|
>
|
||||||
|
Cancel Task
|
||||||
|
{/* <span className='text-gradient'>Cancel</span> */}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,21 @@ export default function JobDetailPopout({action, situation, jobDetail}) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body-wrapper">
|
<div className="modal-body-wrapper">
|
||||||
<p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p>
|
{/* <p className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'>{jobDetail}</p> */}
|
||||||
|
{/* <div
|
||||||
|
className='w-full text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white'
|
||||||
|
dangerouslySetInnerHTML={{__html: jobDetail}}
|
||||||
|
>
|
||||||
|
</div> */}
|
||||||
|
<textarea
|
||||||
|
id="Job Delivery Details"
|
||||||
|
readOnly
|
||||||
|
// rows="5"
|
||||||
|
className={`w-full h-full overflow-y-auto text-left text-sm md:text-lg lg:text-xl text-slate-900 dark:text-white`}
|
||||||
|
style={{ resize: "none" }}
|
||||||
|
name="job_detail"
|
||||||
|
value={jobDetail}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-footer-wrapper justify-end">
|
<div className="modal-footer-wrapper justify-end">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -0,0 +1,225 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import dataImage1 from "../../assets/images/data-table-user-1.png";
|
||||||
|
import PaginatedList from "../Pagination/PaginatedList";
|
||||||
|
import { handlePagingFunc } from "../Pagination/HandlePagination";
|
||||||
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
|
import { useNavigate, useLocation } from "react-router-dom";
|
||||||
|
import { PriceFormatter } from "../Helpers/PriceFormatter";
|
||||||
|
import localImgLoad from "../../lib/localImgLoad";
|
||||||
|
|
||||||
|
const noTasksBg = require("../../assets/images/no-task-background.jpg");
|
||||||
|
const noFamilyTasksBg = require("../../assets/images/family-no-task-background.jpg");
|
||||||
|
|
||||||
|
export default function RecentPastDueTable({ className, recentPastDue, Account, imageServer }) {
|
||||||
|
let navigate = useNavigate();
|
||||||
|
let { pathname } = useLocation();
|
||||||
|
|
||||||
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
|
const indexOfFirstItem = Number(currentPage);
|
||||||
|
const indexOfLastItem =
|
||||||
|
Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE);
|
||||||
|
const currentTask = recentPastDue?.data?.result_list?.slice(
|
||||||
|
indexOfFirstItem,
|
||||||
|
indexOfLastItem
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlePagination = (e) => {
|
||||||
|
handlePagingFunc(e, setCurrentPage);
|
||||||
|
};
|
||||||
|
|
||||||
|
let accountType = Account?.account_type == "FULL"
|
||||||
|
|
||||||
|
// To navigate to task
|
||||||
|
const [btnLoader, setBtnLoader] = useState(false);
|
||||||
|
const navigateMarket = () => {
|
||||||
|
setBtnLoader(true);
|
||||||
|
const timeoutId = setTimeout(() => {
|
||||||
|
navigate(accountType ? "/market" : "/familymarket", { replace: true });
|
||||||
|
setBtnLoader(false);
|
||||||
|
}, 2500);
|
||||||
|
return () => clearTimeout(timeoutId);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`update-table w-full p-8 bg-white dark:bg-dark-white overflow-hidden rounded-2xl section-shadow min-h-[520px] relative ${
|
||||||
|
className || ""
|
||||||
|
} bg-cover bg-center`}
|
||||||
|
style={{
|
||||||
|
backgroundImage: !recentPastDue?.data?.result_list?.length
|
||||||
|
? `url('${accountType ? noTasksBg : noFamilyTasksBg}')`
|
||||||
|
: "none",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* Adding this dark overlay in order to see the texts properly */}
|
||||||
|
{!recentPastDue?.data?.result_list?.length && accountType && (
|
||||||
|
<div className="absolute inset-0 bg-black opacity-30"></div>
|
||||||
|
)}
|
||||||
|
{recentPastDue?.loading ?
|
||||||
|
<div className="w-full h-[520px] flex items-center justify-center">
|
||||||
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className="relative w-full sm:rounded-lg">
|
||||||
|
<div className="h-auto w-full">
|
||||||
|
{recentPastDue?.data?.result_list?.length > 0 ?
|
||||||
|
currentTask?.map((task, idx) => {
|
||||||
|
// find due date
|
||||||
|
const dueDate = task?.delivery_date.split(" ")[0];
|
||||||
|
let thePrice = PriceFormatter(
|
||||||
|
task?.price * 0.01,
|
||||||
|
task?.currency_code,
|
||||||
|
task?.currency
|
||||||
|
);
|
||||||
|
let image = `${imageServer}${localStorage.getItem('session_token')}/job/${task.origin_job_uid}`
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="bg-white dark:bg-dark-white border-b dark:border-[#5356fb29] w-full flex justify-between items-center hover:bg-gray-50"
|
||||||
|
key={idx}
|
||||||
|
>
|
||||||
|
<div className="py-4 max-w-[80%]">
|
||||||
|
<div className="flex space-x-2 items-center">
|
||||||
|
<div className="w-full min-w-[60px] max-w-[60px] flex-[0.1] h-[60px] rounded-full overflow-hidden flex justify-center items-center">
|
||||||
|
<img
|
||||||
|
src={image}
|
||||||
|
alt="data"
|
||||||
|
className="w-full h-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col flex-[0.9]">
|
||||||
|
<h1 className="font-bold text-xl text-dark-gray dark:text-white">
|
||||||
|
{task?.title}
|
||||||
|
</h1>
|
||||||
|
<span className="text-base text-gray-600">
|
||||||
|
{task?.description}
|
||||||
|
</span>
|
||||||
|
<span className="text-sm text-thin-light-gray flex flext-start gap-1">
|
||||||
|
Reward:
|
||||||
|
<span className="text-purple ml-1">{thePrice}</span>
|
||||||
|
</span>
|
||||||
|
<div className="flex flex-col sm:flex-row items-start gap-1 md:gap-4 md:items-center">
|
||||||
|
<span className="text-sm text-thin-light-gray">
|
||||||
|
Duration:
|
||||||
|
<span className="text-purple ml-1">
|
||||||
|
{Number(task?.timeline_days) === 1
|
||||||
|
? `${task?.timeline_days} day`
|
||||||
|
: `${task?.timeline_days} day(s)`}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-sm text-thin-light-gray">
|
||||||
|
Due Date:
|
||||||
|
<span className="text-purple ml-1">{dueDate}</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-sm text-thin-light-gray">
|
||||||
|
Confirmation:
|
||||||
|
<span className="text-purple ml-1">
|
||||||
|
{task?.contract}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex justify-center items-center py-4 px-2">
|
||||||
|
{accountType ?
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/manage-active-job", {
|
||||||
|
state: { ...task, pathname },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className="px-4 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
{task.owner_status == 'OWNER' ? 'Manage' : 'Send Updates'}
|
||||||
|
</button>
|
||||||
|
:
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/manage-active-job", {
|
||||||
|
state: { ...task, pathname },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
className="w-12 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 11 20"
|
||||||
|
id="Arrow"
|
||||||
|
className="w-[0.7rem]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fillRule="evenodd"
|
||||||
|
d="M.366 19.708c.405.39 1.06.39 1.464 0l8.563-8.264a1.95 1.95 0 0 0 0-2.827L1.768.292A1.063 1.063 0 0 0 .314.282a.976.976 0 0 0-.011 1.425l7.894 7.617a.975.975 0 0 1 0 1.414L.366 18.295a.974.974 0 0 0 0 1.413"
|
||||||
|
// fill=""
|
||||||
|
className="color000000 svgShape fill-[#fff]"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
:
|
||||||
|
<div
|
||||||
|
className={`flex flex-col ${
|
||||||
|
accountType ? "items-center" : "items-end"
|
||||||
|
} justify-center gap-9 my-5`}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`p-2 font-bold text-3xl ${
|
||||||
|
accountType ? "text-white" : "text-sky-blue"
|
||||||
|
} whitespace-nowrap`}
|
||||||
|
>
|
||||||
|
You currently have {accountType ? '"0"' : "no"} Past due task
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={`
|
||||||
|
${!accountType &&
|
||||||
|
"bg-[#f0f8ff] h-[17rem] p-5 rounded-md -translate-x-20"}
|
||||||
|
`}
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className={`${
|
||||||
|
!accountType
|
||||||
|
? "w-[150px] h-20 bg-[#22b14c] text-lg font-semibold rounded-md py-2 px-4"
|
||||||
|
: "w-[115px] h-11 btn-gradient rounded-full"
|
||||||
|
} flex justify-center items-center text-base text-white`}
|
||||||
|
onClick={navigateMarket}
|
||||||
|
>
|
||||||
|
{btnLoader ? (
|
||||||
|
<div className="signup btn-loader"></div>
|
||||||
|
) : accountType ? (
|
||||||
|
"Find Task"
|
||||||
|
) : (
|
||||||
|
"Suggest tasks to your parent"
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* PAGINATION BUTTON */}
|
||||||
|
<PaginatedList
|
||||||
|
onClick={handlePagination}
|
||||||
|
prev={currentPage == 0 ? true : false}
|
||||||
|
next={
|
||||||
|
currentPage + Number(process.env.REACT_APP_ITEM_PER_PAGE) >=
|
||||||
|
recentPastDue?.data?.result_list?.length
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
data={recentPastDue?.data?.result_list}
|
||||||
|
start={indexOfFirstItem}
|
||||||
|
stop={indexOfLastItem}
|
||||||
|
/>
|
||||||
|
{/* END OF PAGINATION BUTTON */}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import Layout from "../Partials/Layout";
|
||||||
|
import RecentPastDueTable from "./RecentPastDueTable";
|
||||||
|
import CommonHead from "../UserHeader/CommonHead";
|
||||||
|
import { useSelector } from "react-redux";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
|
|
||||||
|
export default function RecentlyPastDue({
|
||||||
|
imageServer,
|
||||||
|
recentPastDue,
|
||||||
|
commonHeadData,
|
||||||
|
}) {
|
||||||
|
const { userDetails } = useSelector(
|
||||||
|
(state) => state?.userDetails
|
||||||
|
);
|
||||||
|
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
const [selectTab, setValue] = useState("today");
|
||||||
|
const filterHandler = (value) => {
|
||||||
|
setValue(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
let accountType = userDetails?.account_type == "FULL"
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
{userDetails?.account_type == 'FULL' &&
|
||||||
|
<CommonHead commonHeadData={commonHeadData} />
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="notification-page w-full mb-10">
|
||||||
|
<div className="notification-wrapper w-full">
|
||||||
|
<div className="w-full mb-5 flex justify-between items-center gap-1">
|
||||||
|
<CustomBreadcrumb
|
||||||
|
title = 'Past Due Tasks'
|
||||||
|
breadcrumb={
|
||||||
|
[
|
||||||
|
{ link: "/", title: "Home" },
|
||||||
|
{ link: "/mytask", title: "My Tasks", active: true},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{/* } */}
|
||||||
|
|
||||||
|
{/* <div className='flex gap-4 justify-end'>
|
||||||
|
<>
|
||||||
|
<Link
|
||||||
|
to='/mytask?tab=pastdue'
|
||||||
|
className="px-4 h-10 flex justify-center items-center text-lg md:text-xl rounded-xl text-red-600"
|
||||||
|
>
|
||||||
|
Past Due
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/familymarket");
|
||||||
|
}}
|
||||||
|
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
More Task
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RecentPastDueTable recentPastDue={recentPastDue} Account={userDetails} imageServer={imageServer} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import CommonHead from "../UserHeader/CommonHead";
|
|||||||
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
// import TopSellerTopBuyerSliderSection from "../Home/TopSellerTopBuyerSliderSection";
|
||||||
import MyOffersTable from "./MyOffersTable";
|
import MyOffersTable from "./MyOffersTable";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate, Link } from "react-router-dom";
|
||||||
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
import CustomBreadcrumb from "../Breadcrumb/CustomBreadcrumb";
|
||||||
|
|
||||||
export default function MyTasks({
|
export default function MyTasks({
|
||||||
@@ -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>
|
||||||
@@ -37,7 +37,7 @@ export default function MyTasks({
|
|||||||
<div className="notification-page w-full mb-10">
|
<div className="notification-page w-full mb-10">
|
||||||
<div className="notification-wrapper w-full">
|
<div className="notification-wrapper w-full">
|
||||||
{/* heading */}
|
{/* heading */}
|
||||||
<div className="sm:flex justify-between items-center mb-6">
|
<div className="sm:flex justify-between items-center hidden">
|
||||||
{/* <div className="w-full mb-5 sm:mb-0 flex justify-between items-center gap-1">
|
{/* <div className="w-full mb-5 sm:mb-0 flex justify-between items-center gap-1">
|
||||||
{userDetails.account_type == 'FAMILY' &&
|
{userDetails.account_type == 'FAMILY' &&
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
<h1 className="text-26 font-bold text-dark-gray dark:text-white">
|
||||||
@@ -94,18 +94,32 @@ export default function MyTasks({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{/* } */}
|
{/* } */}
|
||||||
|
<div className='flex gap-4 justify-end'>
|
||||||
|
<>
|
||||||
|
<Link
|
||||||
|
// onClick={() => {
|
||||||
|
// navigate(`/mytask?tab=pastdue`);
|
||||||
|
// }}
|
||||||
|
to='/mytask?tab=pastdue'
|
||||||
|
className="px-4 h-10 flex justify-center items-center text-lg md:text-xl rounded-xl text-red-600"
|
||||||
|
>
|
||||||
|
Past Due
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/familymarket");
|
||||||
|
}}
|
||||||
|
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
>
|
||||||
|
More Task
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
</div>
|
||||||
|
|
||||||
{ActiveJobList?.data?.length > 0 && userDetails.account_type == 'FAMILY' &&
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
navigate("/familymarket");
|
|
||||||
}}
|
|
||||||
className="px-4 h-10 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
|
||||||
>
|
|
||||||
More Task
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
|
<MyJobTable ActiveJobList={ActiveJobList} Account={userDetails} imageServer={MyActiveOffersList.session_image_server} />
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import background from "../../assets/images/bg-sky-blue.jpg";
|
|||||||
import { localImgLoad } from "../../lib";
|
import { localImgLoad } from "../../lib";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
|
import FamilyWalletRedeemOptions from "./FamilyWalletRedeemOptions";
|
||||||
|
import {PriceFormatter} from '../Helpers/PriceFormatter'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -20,7 +21,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
const handleChangeWallet = ({ target: { name } }) => {
|
const handleChangeWallet = ({ target: { name } }) => {
|
||||||
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
|
// FUNCTION TO SWITCH WALLET IF USER HAS MORE THAN TWO WALLETS
|
||||||
const currentWalletSelected = wallet?.data?.filter(
|
const currentWalletSelected = wallet?.data?.filter(
|
||||||
(item) => item.code == name
|
(item) => item.description == name
|
||||||
);
|
);
|
||||||
setSelectedWallet(currentWalletSelected[0]);
|
setSelectedWallet(currentWalletSelected[0]);
|
||||||
setActiveWalletBtn(name);
|
setActiveWalletBtn(name);
|
||||||
@@ -33,7 +34,7 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSelectedWallet(wallet.data[0]);
|
setSelectedWallet(wallet.data[0]);
|
||||||
setActiveWalletBtn(wallet?.data[0]?.code);
|
setActiveWalletBtn(wallet?.data[0]?.description);
|
||||||
}, [wallet]);
|
}, [wallet]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -50,17 +51,17 @@ 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">
|
||||||
{wallet?.data?.map((item) => (
|
{wallet?.data?.map((item, index) => (
|
||||||
<button
|
<button
|
||||||
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
|
className={`py-0.5 px-1 mb-1 rounded-lg border border-orange-500 ${
|
||||||
activeWalletBtn == item?.code && "bg-orange-500"
|
activeWalletBtn == item?.description && "bg-orange-500"
|
||||||
}`}
|
}`}
|
||||||
key={item?.wallet_uid}
|
key={item?.wallet_uid+index}
|
||||||
name={item?.code}
|
name={item?.description}
|
||||||
onClick={handleChangeWallet}
|
onClick={handleChangeWallet}
|
||||||
>
|
>
|
||||||
{item?.description}
|
{item?.description}
|
||||||
@@ -69,30 +70,38 @@ export default function FamilyWalletBox({ wallet, payment }) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="p-5 bg-white-opacity min-h-[240px]"
|
className="p-5 bg-white-opacity min-h-[240px] flex justify-end items-center"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
background: `url(${selectedWallet?.banner}) 0% 0% / cover no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* image */}
|
{/* image */}
|
||||||
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[100px] max-h-min md:max-h-[100px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||||
<img
|
<img
|
||||||
src={localImgLoad(`images/currency/${image}`)}
|
src={localImgLoad(`images/currency/${image}`)}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
alt="currency-icon"
|
alt="currency-icon"
|
||||||
/>
|
/>
|
||||||
|
</div> */}
|
||||||
|
<div className='flex flex-col justify-center'>
|
||||||
|
<p className="text-base sm:text-lg text-white tracking-wide my-3 text-center">
|
||||||
|
Current Balance
|
||||||
|
</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">
|
||||||
|
{PriceFormatter(
|
||||||
|
selectedWallet?.amount / 100,
|
||||||
|
selectedWallet?.code,
|
||||||
|
undefined,
|
||||||
|
"text-[2rem]"
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-base sm:text-lg text-white opacity-[70%] tracking-wide my-3">
|
|
||||||
Current Balance
|
|
||||||
</p>
|
|
||||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10">
|
|
||||||
{Formatter(
|
|
||||||
selectedWallet?.amount / 100,
|
|
||||||
selectedWallet?.code,
|
|
||||||
undefined,
|
|
||||||
"text-[2rem]"
|
|
||||||
)}
|
|
||||||
</p>
|
|
||||||
</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, { Suspense, lazy, 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";
|
||||||
const WalletBox = lazy(() => import("./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,15 +63,19 @@ 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>
|
||||||
<Suspense fallback={<LoadingSpinner size="16" color="sky-blue" />}>
|
|
||||||
<WalletBox
|
<WalletBox
|
||||||
wallet={walletDetails}
|
wallet={walletDetails}
|
||||||
payment={paymentHistory}
|
payment={paymentHistory}
|
||||||
countries={allCountries.data}
|
countries={allCountries.data}
|
||||||
/>
|
/>
|
||||||
</Suspense>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 WalletItemCardFamily from "./WalletItemCardFamily";
|
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,25 +8,32 @@ import WalletItemCardFamily from "./WalletItemCardFamily";
|
|||||||
export default function WalletBox({ wallet, payment, countries }) {
|
export default function WalletBox({ wallet, payment, countries }) {
|
||||||
const { loading, data } = wallet;
|
const { loading, data } = wallet;
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state.userDetails);
|
// console.log('LOG', data[0]?.extra_actions?.SPEND_FROM_BALANCE[0])
|
||||||
const accountType = userDetails?.account_type === "FAMILY";
|
|
||||||
|
// const { userDetails } = useSelector((state) => state.userDetails);
|
||||||
|
// const accountType = userDetails?.account_type === "FAMILY";
|
||||||
|
|
||||||
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">
|
||||||
<div className="balance-inquery w-auto grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] gap-5 mb-11 h-auto">
|
{/* xl:grid-cols[repeat(auto-fill,_minmax(354px,_1fr))] min-[1440px]:grid-cols-[repeat(auto-fill,_minmax(415px,_1fr))] */}
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<div className="w-full h-full flex items-center justify-center">
|
<div className="w-full h-full flex items-center justify-center">
|
||||||
<LoadingSpinner size="16" color="sky-blue" />
|
<LoadingSpinner size="16" color="sky-blue" />
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
data.length > 0 && data.map((item) => (
|
<div className="w-auto grid md:grid-cols-2 xxl:grid-cols-3 gap-4 md:gap-10">
|
||||||
<div key={item.wallet_uid} className="w-full md:max-w-[450px] h-full mb-10 lg:mb-0">
|
{ data?.length > 0 && data.map((item, index) => (
|
||||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
<div key={item.wallet_uid+index} className="w-full h-full">
|
||||||
</div>
|
{item.country ?
|
||||||
))
|
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||||
|
:
|
||||||
|
<WalletItemCardVirtual walletItem={item} payment={payment} countries={countries} />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import React, {useState} from 'react'
|
|||||||
import PaginatedList from '../../Pagination/PaginatedList';
|
import PaginatedList from '../../Pagination/PaginatedList';
|
||||||
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
import { handlePagingFunc } from '../../Pagination/HandlePagination';
|
||||||
|
|
||||||
|
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||||
|
|
||||||
function PurchasesTable({purchase}) {
|
function PurchasesTable({purchase}) {
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
@@ -15,7 +17,7 @@ function PurchasesTable({purchase}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='p-4 flex flex-col justify-between min-h-[500px]'>
|
<div className='py-4 flex flex-col justify-between min-h-[500px]'>
|
||||||
{purchase.data.length ?
|
{purchase.data.length ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className='w-full'>
|
<thead className='w-full'>
|
||||||
@@ -31,8 +33,8 @@ function PurchasesTable({purchase}) {
|
|||||||
<td className="p-4">{item.added_date}<br />
|
<td className="p-4">{item.added_date}<br />
|
||||||
<b>{item.confirmation} </b>
|
<b>{item.confirmation} </b>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4 text-right">{item.amount}</td>
|
<td className="p-4 text-right">{currencySymbol(item.currency, item.amount)}</td>
|
||||||
<td className="p-4 text-right">{item.fee}</td>
|
<td className="p-4 text-right">{currencySymbol(item.currency, item.fee)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import React, { useState } from "react";
|
|||||||
import PaginatedList from "../../Pagination/PaginatedList";
|
import PaginatedList from "../../Pagination/PaginatedList";
|
||||||
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
import { handlePagingFunc } from "../../Pagination/HandlePagination";
|
||||||
|
|
||||||
|
import { currencySymbol } from '../../Helpers/PriceFormatter';
|
||||||
|
|
||||||
function RecentActivityTable({ payment }) {
|
function RecentActivityTable({ payment }) {
|
||||||
const [currentPage, setCurrentPage] = useState(0);
|
const [currentPage, setCurrentPage] = useState(0);
|
||||||
const indexOfFirstItem = Number(currentPage);
|
const indexOfFirstItem = Number(currentPage);
|
||||||
@@ -18,7 +20,7 @@ function RecentActivityTable({ payment }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-4 flex flex-col justify-between min-h-[500px]">
|
<div className="py-4 flex flex-col justify-between min-h-[500px]">
|
||||||
{payment?.data?.length > 0 ?
|
{payment?.data?.length > 0 ?
|
||||||
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
<table className="wallet-activity w-full table-auto border-collapse text-left">
|
||||||
<thead className="w-full">
|
<thead className="w-full">
|
||||||
@@ -38,9 +40,9 @@ function RecentActivityTable({ payment }) {
|
|||||||
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
dangerouslySetInnerHTML={{ __html: item.recipient }}
|
||||||
></td>
|
></td>
|
||||||
<td className="p-4 text-right">
|
<td className="p-4 text-right">
|
||||||
{item.amount}
|
{currencySymbol(item.currency, item.amount)}
|
||||||
<br />
|
<br />
|
||||||
{item.fee}
|
{currencySymbol(item.currency, item.fee)}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-4">{item.status}</td>
|
<td className="p-4">{item.status}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -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,16 +58,31 @@ 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 ">
|
||||||
<img src={localImgLoad(`images/currency/${image}`)} className="w-14 h-14" alt="" />
|
<img src={value.icon} className="w-14 h-14" alt="currency icon" />
|
||||||
</div>
|
</div>
|
||||||
<div className="name">
|
<div className="name">
|
||||||
<p className="text-2xl font-bold text-dark-gray dark:text-white">
|
<p className="text-2xl font-bold text-dark-gray dark:text-white">
|
||||||
@@ -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.
|
||||||
@@ -44,25 +44,30 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className="current-balance-widget w-full h-full rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between"
|
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
|
||||||
style={{
|
style={{
|
||||||
background: `url(${background}) 0% 0% / cover no-repeat`,
|
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="wallet w-full flex justify-between items-start gap-3">
|
<div className="wallet w-full">
|
||||||
<div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||||
<img
|
<img
|
||||||
src={localImgLoad(`images/currency/${image}`)}
|
src={localImgLoad(`images/currency/${image}`)}
|
||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
alt="currency-icon"
|
alt="currency-icon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> */}
|
||||||
<div className="balance w-full mt-2 flex justify-center">
|
<div className="balance w-full mt-2 flex justify-end">
|
||||||
<div className="">
|
<div className="flex flex-col items-center">
|
||||||
<p className="text-base sm:text-lg text-white opacity-[70%] 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>
|
||||||
<p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
|
{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">
|
||||||
{PriceFormatter(
|
{PriceFormatter(
|
||||||
walletItem.amount * 0.01,
|
walletItem.amount * 0.01,
|
||||||
walletItem.code,
|
walletItem.code,
|
||||||
@@ -70,29 +75,48 @@ export default function WalletItemCard({ walletItem, payment, countries }) {
|
|||||||
"text-[2rem]"
|
"text-[2rem]"
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
{walletItem.escrow > 0 & (!walletItem?.brand && !walletItem?.card_last4 ) ?
|
||||||
HOLDINGS :{" "}
|
<div className='w-full flex justify-end'>
|
||||||
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||||
{PriceFormatter(
|
HOLDINGS :{" "}
|
||||||
walletItem.escrow * 0.01,
|
<span className="">
|
||||||
walletItem.code,
|
{PriceFormatter(
|
||||||
undefined,
|
walletItem.escrow * 0.01,
|
||||||
"text-[1.5rem]"
|
walletItem.code,
|
||||||
)}
|
undefined,
|
||||||
</span>
|
"text-[1.5rem]"
|
||||||
</p>
|
)}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
<div className="w-full h-[1px] bg-white"></div>
|
{(!walletItem?.brand || !walletItem?.card_last4) ?
|
||||||
|
<div className='w-full'>
|
||||||
|
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||||
|
<WalletAction
|
||||||
|
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||||
|
payment={payment}
|
||||||
|
openPopUp={openPopUp}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<div className='w-full'>
|
||||||
|
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||||
|
<VirtualCardAction
|
||||||
|
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
||||||
|
payment={payment}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<WalletAction
|
|
||||||
walletItem={{ ...walletItem, walletCountry: currentWalletCurrency }}
|
|
||||||
payment={payment}
|
|
||||||
openPopUp={openPopUp}
|
|
||||||
/>
|
|
||||||
</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 )
|
||||||
@@ -0,0 +1,617 @@
|
|||||||
|
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 VirtualAddCardPopout = ({ 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: ''})
|
||||||
|
|
||||||
|
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: userDetails?.firstname,
|
||||||
|
lastname: userDetails?.lastname,
|
||||||
|
birthYear: '',
|
||||||
|
birthMonth: '',
|
||||||
|
birthDay: '',
|
||||||
|
address: '',
|
||||||
|
city: userDetails?.city ? userDetails.city : '',
|
||||||
|
state: '',
|
||||||
|
zipCode: '',
|
||||||
|
dob: '',
|
||||||
|
checked: false
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const handleSubmit = (values) => {
|
||||||
|
// const reqData1 = {
|
||||||
|
// name: values.firstname + ' ' + values.firstname,
|
||||||
|
// email: values.email,
|
||||||
|
// phone_number: values.phone_number,
|
||||||
|
// status: 'active',
|
||||||
|
// type: 'individual',
|
||||||
|
// individual: {
|
||||||
|
// first_name: values.firstname,
|
||||||
|
// last_name: values.lastname,
|
||||||
|
// dob: {day: values.birthDay, month: values.birthMonth, year: values.birthYear}
|
||||||
|
// },
|
||||||
|
// billing:{
|
||||||
|
// address : {
|
||||||
|
// line1: values.address,
|
||||||
|
// city: values.city,
|
||||||
|
// state: values.state,
|
||||||
|
// postal_code: values.zipCode,
|
||||||
|
// country: values.country
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
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
|
||||||
|
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>{userDetails.lastname} {userDetails.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 VirtualAddCardPopout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 )
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import usersService from "../../../services/UsersService";
|
||||||
|
|
||||||
|
|
||||||
|
function WalletActionVirtual({ walletItem, openPopUp, btnText }) {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="counters w-full flex justify-end gap-2">
|
||||||
|
<div className="w-1/2 flex justify-end items-center">
|
||||||
|
<button
|
||||||
|
className="logout-btn btn-gradient text-white"
|
||||||
|
onClick={() => {
|
||||||
|
openPopUp(walletItem?.description, {walletItem});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{btnText}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WalletActionVirtual;
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
import localImgLoad from "../../../lib/localImgLoad";
|
||||||
|
import { tableReload } from "../../../store/TableReloads";
|
||||||
|
import { PriceFormatter } from "../../Helpers/PriceFormatter";
|
||||||
|
import WalletActionVirtual from "./WalletActionVirtual";
|
||||||
|
import VirtualAddCardPopout from "./VirtualAddCardPopout";
|
||||||
|
import WrenchTokenPopout from './WrenchTokenPopout'
|
||||||
|
import WrenchPointPopout from './WrenchPointPopout'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a card displaying information about a wallet item.
|
||||||
|
*/
|
||||||
|
export default function WalletItemCardVirtual({ walletItem, payment, countries }) {
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [virtualPopup, setVirtualPopup] = useState({ name: '', data: {} });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the credit popup.
|
||||||
|
* @param {Object} value - The value object.
|
||||||
|
*/
|
||||||
|
const openPopUp = (name, value) => {
|
||||||
|
setVirtualPopup({
|
||||||
|
name: name.toLowerCase(),
|
||||||
|
data: { ...value },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the credit popup and dispatches a table reload action.
|
||||||
|
*/
|
||||||
|
const closePopUp = () => {
|
||||||
|
setVirtualPopup({ name: false, data: {} });
|
||||||
|
// dispatch(tableReload({ type: "WALLETTABLE" }));
|
||||||
|
};
|
||||||
|
|
||||||
|
const currentWalletCurrency = countries?.filter((country) => country.code === walletItem.country);
|
||||||
|
|
||||||
|
const image = walletItem.code
|
||||||
|
? `${walletItem.code.toLowerCase()}.svg`
|
||||||
|
: "default.png";
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className="current-balance-widget w-full h-full min-h-[250px] rounded-2xl overflow-hidden flex flex-col items-center gap-4 p-4 justify-between bg-[#498FC3]"
|
||||||
|
style={{
|
||||||
|
background: `url(${walletItem?.banner}) 0% 0% / cover no-repeat`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="wallet w-full">
|
||||||
|
{/* <div className="min-w-[100px] min-h-[100px] max-w-min md:max-w-[150px] max-h-min md:max-h-[150px] rounded-full bg-[#e3e3e3] flex justify-center items-center">
|
||||||
|
<img
|
||||||
|
src={localImgLoad(`images/currency/${image}`)}
|
||||||
|
className="w-full h-full"
|
||||||
|
alt="currency-icon"
|
||||||
|
/>
|
||||||
|
</div> */}
|
||||||
|
<div className="balance w-full mt-2 flex justify-end">
|
||||||
|
<div className="">
|
||||||
|
<p className="text-lg sm:text-2xl font-bold text-white tracking-wide mb-2 sm:mb-6">
|
||||||
|
{walletItem?.description}
|
||||||
|
</p>
|
||||||
|
{/* <p className="text-[44px] lg:text-[62px] font-bold text-white tracking-wide leading-10 xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||||
|
{PriceFormatter(
|
||||||
|
walletItem.amount * 0.01,
|
||||||
|
walletItem.code,
|
||||||
|
undefined,
|
||||||
|
"text-[2rem]"
|
||||||
|
)}
|
||||||
|
</p> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* {walletItem.escrow > 0 ?
|
||||||
|
<p className="text-lg text-white tracking-wide flex justify-center items-center gap-8">
|
||||||
|
HOLDINGS :{" "}
|
||||||
|
<span className="xxs:scale-100 lg:scale-100 xl:scale-125">
|
||||||
|
{PriceFormatter(
|
||||||
|
walletItem.escrow * 0.01,
|
||||||
|
walletItem.code,
|
||||||
|
undefined,
|
||||||
|
"text-[1.5rem]"
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
} */}
|
||||||
|
<div className='w-full'>
|
||||||
|
<div className="w-full h-[1px] mb-2 bg-white"></div>
|
||||||
|
<WalletActionVirtual
|
||||||
|
walletItem={walletItem}
|
||||||
|
openPopUp={openPopUp}
|
||||||
|
btnText={walletItem?.rt_action_text}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{virtualPopup.name == 'add virtual debit card' && (
|
||||||
|
<VirtualAddCardPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closePopUp}
|
||||||
|
situation={virtualPopup.name}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{virtualPopup.name == 'wrench token' && (
|
||||||
|
<WrenchTokenPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closePopUp}
|
||||||
|
situation={virtualPopup.name}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{virtualPopup.name == 'wrench points' && (
|
||||||
|
<WrenchPointPopout
|
||||||
|
details={virtualPopup.data}
|
||||||
|
walletItem={walletItem}
|
||||||
|
onClose={closePopUp}
|
||||||
|
situation={virtualPopup.name}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import CustomTimer from "../../countdown/CustomTimer";
|
||||||
|
|
||||||
|
const WrenchPointPopout = ({ details, onClose, situation, walletItem }) => {
|
||||||
|
const [input, setInput] = useState("");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom
|
||||||
|
action={onClose}
|
||||||
|
situation={situation}
|
||||||
|
>
|
||||||
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<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="w-full h-[32rem]">
|
||||||
|
{/* <div className="h-[32rem] flex items-center justify-center">
|
||||||
|
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
|
||||||
|
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
|
||||||
|
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
|
||||||
|
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</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>
|
||||||
|
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={()=>{}}
|
||||||
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
|
>
|
||||||
|
{/* {requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : completeNairaWithdraw.show ? (
|
||||||
|
"Okay"
|
||||||
|
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
|
||||||
|
"Cancel"
|
||||||
|
) : (
|
||||||
|
"Transfer"
|
||||||
|
)} */}
|
||||||
|
Continue
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WrenchPointPopout;
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import { useState } from "react";
|
||||||
|
import ModalCom from "../../Helpers/ModalCom";
|
||||||
|
import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
||||||
|
import CustomTimer from "../../countdown/CustomTimer";
|
||||||
|
|
||||||
|
const WrenchTokenPopout = ({ details, onClose, situation, walletItem }) => {
|
||||||
|
const [input, setInput] = useState("");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalCom
|
||||||
|
action={onClose}
|
||||||
|
situation={situation}
|
||||||
|
>
|
||||||
|
<div className="logout-modal-wrapper w-[90%] md:w-[768px] h-auto bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
|
<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="w-full h-[32rem]">
|
||||||
|
{/* <div className="h-[32rem] flex items-center justify-center">
|
||||||
|
<div className="h-[32rem] flex flex-col items-center justify-center gap-4">
|
||||||
|
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Processing payment</p>
|
||||||
|
<p className="text-lg md:text-2xl text-emerald-600 tracking-wide font-bold">Please do not refresh</p>
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" height='h-20' />
|
||||||
|
<CustomTimer className="text-lg text-center md:text-2xl text-emerald-600 tracking-wide font-bold" />
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
|
</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>
|
||||||
|
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={()=>{}}
|
||||||
|
className="custom-btn btn-gradient text-base text-white"
|
||||||
|
>
|
||||||
|
{/* {requestStatus.loading ? (
|
||||||
|
<LoadingSpinner size="6" color="sky-blue" />
|
||||||
|
) : completeNairaWithdraw.show ? (
|
||||||
|
"Okay"
|
||||||
|
) : completeNairaWithdraw?.state?.internal_return < 0 ? (
|
||||||
|
"Cancel"
|
||||||
|
) : (
|
||||||
|
"Transfer"
|
||||||
|
)} */}
|
||||||
|
Continue
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ModalCom>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WrenchTokenPopout;
|
||||||
@@ -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>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{userDetails && userDetails?.account_type !== "FAMILY" && (
|
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
|
||||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||||
<Link to="/yourpage" className="notifications">
|
<Link to="/yourpage" className="notifications">
|
||||||
<div className="name">
|
<div className="name">
|
||||||
@@ -480,7 +480,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
|
|||||||
{/* end Language list items*/}
|
{/* end Language list items*/}
|
||||||
</li>
|
</li>
|
||||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||||
<Link to="#" className="notifications">
|
<Link to="/settings" className="notifications">
|
||||||
<div className="name">
|
<div className="name">
|
||||||
<p className="text-sm py-2 px-4 text-dark-gray dark:text-white hover:text-sky-blue transition font-medium">
|
<p className="text-sm py-2 px-4 text-dark-gray dark:text-white hover:text-sky-blue transition font-medium">
|
||||||
Account Settings
|
Account Settings
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ export default function MediaHeader({ logoutModalHandler, sidebarHandler, backpa
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{userDetails && userDetails?.account_type !== "FAMILY" && (
|
{(userDetails && userDetails?.account_type !== "FAMILY" && Number(process.env.REACT_APP_SHOW_USER_PAGE) == 1) && (
|
||||||
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
<li className="content-item my-2 hover:bg-slate-100 transition duration-500 rounded-lg">
|
||||||
<Link to="/yourpage" className="notifications">
|
<Link to="/yourpage" className="notifications">
|
||||||
<div className="name">
|
<div className="name">
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default function MobileSidebar({
|
|||||||
{/* Using mini component reduces the bulk amount of html */}
|
{/* Using mini component reduces the bulk amount of html */}
|
||||||
<ListItem
|
<ListItem
|
||||||
title={
|
title={
|
||||||
userDetails?.account_type == "FULL" ? "Dashboard" : "Home"
|
userDetails?.account_type == "FULL" ? "Home" : "Home"
|
||||||
}
|
}
|
||||||
route="/"
|
route="/"
|
||||||
sidebar={sidebar}
|
sidebar={sidebar}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user