Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d05da30ca | |||
| 6e97121f96 | |||
| d78c30d9b5 | |||
| 6be6d5cecd | |||
| 997985a45d | |||
| 630b32e78d | |||
| 837d68f3a1 | |||
| 0a2c4b86f3 | |||
| e7a46c25c1 | |||
| 8e9ae8187f | |||
| b25a9c154b | |||
| 66bfe4be82 | |||
| e6c02468de | |||
| 8a5b784381 |
+1
-1
@@ -94,7 +94,7 @@ export default function Routers() {
|
|||||||
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
<Route path="/complereset" element={<VerifyPasswordPagesTwo />} />
|
||||||
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
<Route exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
||||||
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
<Route exact path="/eoffer" element={<LoginPageTwo />} />
|
||||||
<Route exact path="/invite" element={<LoginPageTwo />} />
|
<Route exact path="/invite" element={<SignupPageTwo />} />
|
||||||
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
<Route exact path="/promo/:name/:id" element={<PromoPage />} />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import WrenchBoard from "../../assets/images/wrenchboard-logo-text.png";
|
|||||||
|
|
||||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||||
|
|
||||||
export default function LoginLayout({ slogan, children }) {
|
export default function AuthLayout2({ slogan, children }) {
|
||||||
// const bgImg = localImgLoad("images/left-wrenchboard.jpg");
|
// const bgImg = localImgLoad("images/left-wrenchboard.jpg");
|
||||||
const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg");
|
const bgImgNig = localImgLoad("images/wrench-home-back-nigeria.jpg");
|
||||||
const bgImgCom = localImgLoad("images/wrench-home-back-common.jpg");
|
const bgImgCom = localImgLoad("images/wrench-home-back-common.jpg");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout2";
|
|||||||
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
import GoogleDownload from '../../../assets/images/download/andriod.jpg'
|
||||||
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
import IOSDownload from '../../../assets/images/download/apple.jpg'
|
||||||
|
|
||||||
export default function SignUp() {
|
export default function SignUp({details}) {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
@@ -28,9 +28,9 @@ export default function SignUp() {
|
|||||||
|
|
||||||
const [formData, setFormData] = useState({
|
const [formData, setFormData] = useState({
|
||||||
country: country ? country : "",
|
country: country ? country : "",
|
||||||
first_name: "",
|
first_name: details ? details.first_name : "",
|
||||||
last_name: "",
|
last_name: details ? details.last_name : "",
|
||||||
email: "",
|
email: details ? details.email : "",
|
||||||
password: "",
|
password: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -202,6 +202,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.first_name}
|
value={formData.first_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.first_name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item flex-1">
|
<div className="input-item flex-1">
|
||||||
@@ -213,6 +214,7 @@ export default function SignUp() {
|
|||||||
type="text"
|
type="text"
|
||||||
value={formData.last_name}
|
value={formData.last_name}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.last_name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -225,6 +227,7 @@ export default function SignUp() {
|
|||||||
type="email"
|
type="email"
|
||||||
value={formData.email}
|
value={formData.email}
|
||||||
inputHandler={handleInputChange}
|
inputHandler={handleInputChange}
|
||||||
|
disable={details.email}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-item mb-4">
|
<div className="input-item mb-4">
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ export default function SocketIOContextProvider({children}) {
|
|||||||
let {message} = data
|
let {message} = data
|
||||||
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child account when parent assigns a job
|
if(message.action == "REFRESH_OFFER" && message.family_uid == user_uid && message.audience == "MEMBER"){ // for refreshing child account when parent assigns a job
|
||||||
dispatch(tableReload({type:'FAMILYOFFERLIST'})) // dispatches to update family pending/offer list on family side
|
dispatch(tableReload({type:'FAMILYOFFERLIST'})) // dispatches to update family pending/offer list on family side
|
||||||
|
dispatch(tableReload({ type: "FAMILYBANNERSLIST" })) // dispatches to update family banner list on family side
|
||||||
}
|
}
|
||||||
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
|
if(message.action == "REFRESH_TASK" && message.audience == "PARENT"){ // for refreshing parent account when child accepts or rejects a job
|
||||||
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import { tableReload } from "../../store/TableReloads";
|
|||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
import HomeModal from "./HomeModal";
|
import HomeModal from "./HomeModal";
|
||||||
|
|
||||||
export default function FamilyDash({ MyActiveJobList=[], serverImg }) {
|
export default function FamilyDash() {
|
||||||
// console.log("PROPS IN FAMILY DASH->", familyOffers?.result_list);
|
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
@@ -17,29 +16,27 @@ export default function FamilyDash({ MyActiveJobList=[], serverImg }) {
|
|||||||
|
|
||||||
const userApi = new usersService();
|
const userApi = new usersService();
|
||||||
|
|
||||||
// const trending = MyActiveJobList;
|
|
||||||
|
|
||||||
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
const { familyBannersList } = useSelector((state) => state.familyBannersList);
|
||||||
|
|
||||||
const { familyResources:{ tab_categories } } = useSelector((state) => state.familyResources);
|
const { familyResources:{ tab_categories } } = useSelector((state) => state.familyResources);
|
||||||
|
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
let [reloadBanner, setReloadBanner] = useState(0)
|
// let [reloadBanner, setReloadBanner] = useState(0)
|
||||||
|
|
||||||
useEffect(()=>{
|
// useEffect(()=>{
|
||||||
if(reloadBanner >= 2){
|
// if(reloadBanner >= 2){
|
||||||
dispatch(tableReload({ type: "FAMILYBANNERSLIST" })); // RELOAD FAMILY BANNERS LIST EVERY 10 MINS
|
// dispatch(tableReload({ type: "FAMILYBANNERSLIST" })); // RELOAD FAMILY BANNERS LIST EVERY 10 MINS
|
||||||
setReloadBanner(0)
|
// setReloadBanner(0)
|
||||||
}
|
// }
|
||||||
const timer = setInterval(()=>{
|
// const timer = setInterval(()=>{
|
||||||
setReloadBanner(prev => prev+1)
|
// setReloadBanner(prev => prev+1)
|
||||||
},300000)
|
// },300000)
|
||||||
|
|
||||||
return ()=>{
|
// return ()=>{
|
||||||
clearInterval(timer)
|
// clearInterval(timer)
|
||||||
}
|
// }
|
||||||
},[reloadBanner])
|
// },[reloadBanner])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ export default function Home(props) {
|
|||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
||||||
<FamilyDash
|
<FamilyDash
|
||||||
account={userDetails}
|
account={userDetails}
|
||||||
commonHeadData={commonHeadBanner?.data?.result_list}
|
|
||||||
serverImg = {userDetails?.session_image_server}
|
|
||||||
/>
|
/>
|
||||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
) : userDetails && userDetails?.account_type == "FULL" ? (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ function ReferralTable({ history }) {
|
|||||||
currentReferral.map((item, index) => (
|
currentReferral.map((item, index) => (
|
||||||
<tr key={index} className="text-slate-500">
|
<tr key={index} className="text-slate-500">
|
||||||
<td className="p-3">
|
<td className="p-3">
|
||||||
{item.added_date} / {item.firstname} {item.lastname}
|
<div style={{flexDirection: "column"}} >
|
||||||
|
<div style={{color: "blue"}}>{item.added_date} </div>
|
||||||
|
<div>{item.firstname} {item.lastname}</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3">{item.email}</td>
|
<td className="p-3">{item.email}</td>
|
||||||
<td className="p-3">{item.status}</td>
|
<td className="p-3">{item.status}</td>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import axios from 'axios'
|
|||||||
function Default({ children }) {
|
function Default({ children }) {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
|
||||||
|
const [nocache, setNoCache] = useState(false) // holds cache/nocache value
|
||||||
|
|
||||||
// dark mode setup
|
// dark mode setup
|
||||||
const [theme, setTheme] = useState(null);
|
const [theme, setTheme] = useState(null);
|
||||||
|
|
||||||
@@ -16,6 +18,10 @@ function Default({ children }) {
|
|||||||
const queryParams = new URLSearchParams(location?.search);
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
const country = queryParams.get("cnt")?.toUpperCase();
|
const country = queryParams.get("cnt")?.toUpperCase();
|
||||||
|
|
||||||
|
const handleThemeSwitch = () => {
|
||||||
|
setTheme(theme === "dark" ? "light" : "dark");
|
||||||
|
};
|
||||||
|
|
||||||
const getLocation = () => {
|
const getLocation = () => {
|
||||||
if (navigator.geolocation) {
|
if (navigator.geolocation) {
|
||||||
navigator.geolocation.getCurrentPosition(
|
navigator.geolocation.getCurrentPosition(
|
||||||
@@ -58,10 +64,6 @@ function Default({ children }) {
|
|||||||
}
|
}
|
||||||
}, [theme]);
|
}, [theme]);
|
||||||
|
|
||||||
const handleThemeSwitch = () => {
|
|
||||||
setTheme(theme === "dark" ? "light" : "dark");
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(country){
|
if(country){
|
||||||
setCountryMode(country)
|
setCountryMode(country)
|
||||||
@@ -75,7 +77,7 @@ function Default({ children }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode }}>
|
<DarkModeContext.Provider value={{ theme, handleThemeSwitch, countryMode, nocache, setNoCache }}>
|
||||||
{children && children}
|
{children && children}
|
||||||
</DarkModeContext.Provider>
|
</DarkModeContext.Provider>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { toast } from "react-toastify";
|
// import { toast } from "react-toastify";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import InputCom from "../Helpers/Inputs/InputCom";
|
import InputCom from "../Helpers/Inputs/InputCom";
|
||||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||||
@@ -74,7 +74,7 @@ function ReferralDisplay() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//FUNCTION TO SEND REFERRAL MESSAGE
|
//FUNCTION TO SEND REFERRAL MESSAGE
|
||||||
const sendReferralMsg = (postData) => {
|
const sendReferralMsg = (postData, helpers) => {
|
||||||
apiCall
|
apiCall
|
||||||
.sendReferralMsg(postData)
|
.sendReferralMsg(postData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -84,11 +84,17 @@ function ReferralDisplay() {
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
return;
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: false });
|
||||||
|
},3000)
|
||||||
} else {
|
} else {
|
||||||
toast.success(res.data.status | "Message Sent!");
|
// toast.success(res.data.status | "Message Sent!");
|
||||||
setError({ message: "", loading: false, status: true });
|
setError({ message: res.data.status, loading: false, status: true });
|
||||||
|
helpers.resetForm() // resets the form data
|
||||||
setRefHistoryReload((prev) => !prev);
|
setRefHistoryReload((prev) => !prev);
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: true });
|
||||||
|
},3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -97,13 +103,16 @@ function ReferralDisplay() {
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: false });
|
||||||
|
},3000)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//FUNCTION TO HANDLE SUBMIT
|
//FUNCTION TO HANDLE SUBMIT
|
||||||
const handleSubmit = (values, helpers) => {
|
const handleSubmit = (values, helpers) => {
|
||||||
setError({ message: "", loading: true, status: false });
|
setError({ message: "", loading: true, status: false });
|
||||||
sendReferralMsg({...values}); // FUNCTION TO SEND REFERRAL MESSAGE
|
sendReferralMsg({...values}, helpers); // FUNCTION TO SEND REFERRAL MESSAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
const [selectedTab, setSelectedTab] = useState("Send Referral");
|
const [selectedTab, setSelectedTab] = useState("Send Referral");
|
||||||
@@ -228,7 +237,7 @@ function ReferralDisplay() {
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
{error.message != "" && (
|
{error.message != "" && (
|
||||||
<p className="text-base text-red-500 py-2">{error.message}</p>
|
<p className={`text-base py-2 ${error.status ? 'text-emerald-500' : 'text-red-500'}`}>{error.message}</p>
|
||||||
)}
|
)}
|
||||||
<div className="referral-btn flex justify-end items-center py-4">
|
<div className="referral-btn flex justify-end items-center py-4">
|
||||||
{error.loading ? (
|
{error.loading ? (
|
||||||
@@ -237,6 +246,7 @@ function ReferralDisplay() {
|
|||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
className="px-2 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white"
|
||||||
|
disabled={error.loading || error.status}
|
||||||
>
|
>
|
||||||
Send Message
|
Send Message
|
||||||
</button>
|
</button>
|
||||||
@@ -251,9 +261,12 @@ function ReferralDisplay() {
|
|||||||
{selectedTab == 'Referral List' &&
|
{selectedTab == 'Referral List' &&
|
||||||
<>
|
<>
|
||||||
<div className="w-full p-4">
|
<div className="w-full p-4">
|
||||||
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
<div className='mb-2 flex flex-wrap gap-4 items-center'>
|
||||||
Referral List
|
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||||
</h2>
|
Referral List
|
||||||
|
</h2>
|
||||||
|
<p className='text-slate-900 dark:text-white text-sm lg:text-base'>Uncompleted signup will be removed automatically after 7 days</p>
|
||||||
|
</div>
|
||||||
{referralList.loading ? (
|
{referralList.loading ? (
|
||||||
<LoadingSpinner size="22" color="sky-blue" />
|
<LoadingSpinner size="22" color="sky-blue" />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState, useContext } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
||||||
import LoadingSpinner from "../components/Spinners/LoadingSpinner";
|
import LoadingSpinner from "../components/Spinners/LoadingSpinner";
|
||||||
@@ -15,16 +15,20 @@ import { familyBannersList } from "../store/FamilyBannerList";
|
|||||||
import { familyResources } from "../store/FamilyResources";
|
import { familyResources } from "../store/FamilyResources";
|
||||||
import {familyWalletRedeemOptList} from '../store/FamilyWalletRedeemOpt'
|
import {familyWalletRedeemOptList} from '../store/FamilyWalletRedeemOpt'
|
||||||
import { SocketValues } from "../components/Contexts/SocketIOContext";
|
import { SocketValues } from "../components/Contexts/SocketIOContext";
|
||||||
|
import DarkModeContext from '../components/Contexts/DarkModeContext'
|
||||||
|
|
||||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||||
|
|
||||||
let {joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
let {joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||||
|
|
||||||
|
// const [nocache, setNoCache] = useState(false) // holds cache/nocache value
|
||||||
|
|
||||||
|
const {nocache, setNoCache} = useContext(DarkModeContext); // Destructures nocache and set nocache from context API
|
||||||
|
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
||||||
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
||||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
||||||
@@ -46,19 +50,12 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const checkInactivity = setInterval(() => {
|
const checkInactivity = setInterval(() => {
|
||||||
let { account_type } = loadProfileDetails;
|
|
||||||
if (account_type === "FAMILY") {
|
if (account_type === "FAMILY") {
|
||||||
if (
|
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY)) {
|
||||||
Date.now() - lastActivityTime >
|
|
||||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY
|
|
||||||
) {
|
|
||||||
expireSession();
|
expireSession();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES)) {
|
||||||
Date.now() - lastActivityTime >
|
|
||||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
|
|
||||||
) {
|
|
||||||
expireSession();
|
expireSession();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +65,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
return () => {
|
return () => {
|
||||||
clearInterval(checkInactivity);
|
clearInterval(checkInactivity);
|
||||||
};
|
};
|
||||||
}, [lastActivityTime, navigate]);
|
}, [lastActivityTime, navigate, isLogin.status]);
|
||||||
|
|
||||||
// Reset last activity time on user input
|
// Reset last activity time on user input
|
||||||
const resetTime = useCallback(() => {
|
const resetTime = useCallback(() => {
|
||||||
@@ -97,9 +94,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
setIsLogin({ loading: false, status: false });
|
setIsLogin({ loading: false, status: false });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoadProfileDetails(res.data);
|
|
||||||
dispatch(updateUserDetails({ ...res.data }));
|
dispatch(updateUserDetails({ ...res.data }));
|
||||||
setIsLogin({ loading: false, status: true });
|
setIsLogin({ loading: false, status: true });
|
||||||
|
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setIsLogin({ loading: false, status: false });
|
setIsLogin({ loading: false, status: false });
|
||||||
@@ -108,12 +105,13 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
loadProfile();
|
loadProfile();
|
||||||
}else{
|
}else{
|
||||||
setIsLogin({ loading: false, status: true });
|
setIsLogin({ loading: false, status: true });
|
||||||
|
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dispatch(commonHeadBanner({loading:true, data:{}}));
|
dispatch(commonHeadBanner({loading:true, data:{}}));
|
||||||
@@ -141,8 +139,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
dispatch(updateNotifications({ loading: false, data: null }));
|
dispatch(updateNotifications({ loading: false, data: null }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setLoadProfileDetails(res.data);
|
|
||||||
|
|
||||||
const _raw = res.data?.result_list;
|
const _raw = res.data?.result_list;
|
||||||
|
|
||||||
//Sort the notifications in ascending order based on the API time
|
//Sort the notifications in ascending order based on the API time
|
||||||
@@ -193,7 +189,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getMyJobList = async () => {
|
const getMyJobList = async () => {
|
||||||
@@ -214,7 +210,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FULL USER WALLETS
|
//FUNCTION TO GET FULL USER WALLETS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getMyWalletList = async () => {
|
const getMyWalletList = async () => {
|
||||||
@@ -236,7 +232,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
// FUNCTION TO GET MARKET JOB LIST
|
// FUNCTION TO GET MARKET JOB LIST
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Getting market data
|
// Getting market data
|
||||||
@@ -255,7 +251,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET COMMON HEAD DATA
|
//FUNCTION TO GET COMMON HEAD DATA
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
// if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// apiCall
|
// apiCall
|
||||||
@@ -275,13 +271,16 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY BANNERS
|
//FUNCTION TO GET FAMILY BANNERS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getFamilyBanners = async () => { // FUNCTION TO GET FAMILY BANNERS
|
const getFamilyBanners = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||||
// setFamilyBannersList({loading:true, result:[]});
|
// setFamilyBannersList({loading:true, result:[]});
|
||||||
|
dispatch(familyBannersList({loading:true}))
|
||||||
|
const noCache = (isLogin.status && nocache )? 1 : 0
|
||||||
|
const reqData = {nocache: noCache}
|
||||||
try {
|
try {
|
||||||
const res = await apiCall.getFamilyBannersList();
|
const res = await apiCall.getFamilyBannersList(reqData);
|
||||||
dispatch(familyBannersList({...res?.data, loading:false}))
|
dispatch(familyBannersList({...res?.data, loading:false}))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(familyBannersList({loading:false}))
|
dispatch(familyBannersList({loading:false}))
|
||||||
@@ -293,7 +292,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY RESOURCES
|
//FUNCTION TO GET FAMILY RESOURCES
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||||
@@ -311,7 +310,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
|
|
||||||
//FUNCTION TO GET FAMILY WALLET REDEEM OPTIONS
|
//FUNCTION TO GET FAMILY WALLET REDEEM OPTIONS
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
if((!loggedIn && !isLogin.status) || isLogin.loading || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const familyWalletRedeemOptions = async () => { // FUNCTION TO GET FAMILY WALLET REDDEM OPTIONS
|
const familyWalletRedeemOptions = async () => { // FUNCTION TO GET FAMILY WALLET REDDEM OPTIONS
|
||||||
|
|||||||
@@ -618,8 +618,8 @@ class usersService {
|
|||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
sessionid: localStorage.getItem("session_token"),
|
sessionid: localStorage.getItem("session_token"),
|
||||||
offset: 1,
|
offset: 0,
|
||||||
limit: 100,
|
limit: 140,
|
||||||
action: apiConst.WRENCHBOARD_ACCOUNT_REFFERHX,
|
action: apiConst.WRENCHBOARD_ACCOUNT_REFFERHX,
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/refferhx", postData);
|
return this.postAuxEnd("/refferhx", postData);
|
||||||
@@ -1396,7 +1396,7 @@ class usersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// API FUNCTION TO FAMILY BANNERS
|
// API FUNCTION TO FAMILY BANNERS
|
||||||
getFamilyBannersList() {
|
getFamilyBannersList(reqData) {
|
||||||
var postData = {
|
var postData = {
|
||||||
uid: localStorage.getItem("uid"),
|
uid: localStorage.getItem("uid"),
|
||||||
member_id: localStorage.getItem("member_id"),
|
member_id: localStorage.getItem("member_id"),
|
||||||
@@ -1404,6 +1404,7 @@ class usersService {
|
|||||||
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
offset: 1,
|
offset: 1,
|
||||||
|
...reqData
|
||||||
};
|
};
|
||||||
return this.postAuxEnd("/familybanners", postData);
|
return this.postAuxEnd("/familybanners", postData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,79 @@
|
|||||||
import React from "react";
|
import React, {useState, useEffect} from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import usersService from '../services/UsersService'
|
||||||
|
|
||||||
import SignUp from "../components/AuthPages/SignUp/index2";
|
import SignUp from "../components/AuthPages/SignUp/index2";
|
||||||
|
import LoadingSpinner from '../components/Spinners/LoadingSpinner'
|
||||||
|
import AuthLayout from '../components/AuthPages/AuthLayout2'
|
||||||
|
|
||||||
function SignupPageTwo() {
|
function SignupPageTwo() {
|
||||||
|
const api = new usersService()
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
const queryParams = new URLSearchParams(location?.search);
|
||||||
|
const refer_link = queryParams.get("refer_link")?.toUpperCase();
|
||||||
|
|
||||||
|
const [reload, setReload] = useState(false)
|
||||||
|
|
||||||
|
let [details, setDetails] = useState({loading:true, error:false, data:{}})
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setDetails({loading:true, error:false, data:{}})
|
||||||
|
if(refer_link){
|
||||||
|
// const timer = setTimeout(()=>{
|
||||||
|
// setDetails({loading:false, data:{
|
||||||
|
// first_name: 'Emeka',
|
||||||
|
// last_name: 'John',
|
||||||
|
// email: 'example@example.com'
|
||||||
|
// }})
|
||||||
|
// },[1000])
|
||||||
|
api.verifyEmail(refer_link).then(res => {
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
console.log('RES', rres)
|
||||||
|
}).catch(err => {
|
||||||
|
setDetails({loading:false, error:true, data:{}})
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
setDetails({loading:false, error:false, data:{}})
|
||||||
|
}
|
||||||
|
},[reload])
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SignUp />
|
{details.loading ?
|
||||||
|
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />
|
||||||
|
: details.error ?
|
||||||
|
<AuthLayout>
|
||||||
|
<ErrorComponent onClick={()=>setReload(prev => !prev)} />
|
||||||
|
</AuthLayout>
|
||||||
|
:
|
||||||
|
<SignUp details={details.data} />
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SignupPageTwo;
|
export default SignupPageTwo;
|
||||||
|
|
||||||
|
|
||||||
|
const ErrorComponent = ({ onClick }) => (
|
||||||
|
<div className="input-area">
|
||||||
|
<div className="my-5">
|
||||||
|
<p className="text-[14px] leading-[19px] text-center text-[#181c32]">
|
||||||
|
This error occurs because you have already verified this link or the
|
||||||
|
link has expired. Try login or reset password. If none worked, try to
|
||||||
|
create the account from the start.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="signin-area flex justify-center mb-3.5">
|
||||||
|
<button
|
||||||
|
onClick={onClick}
|
||||||
|
type="button"
|
||||||
|
className={`rounded-[0.475rem] mb-6 text-[15px] font-semibold text-[#009ef7] hover:text-white flex justify-center bg-[#f1faff] hover:bg-[#009ef7] transition-all duration-300 items-center py-[0.8875rem] px-[1.81rem]`}
|
||||||
|
>
|
||||||
|
<span>Try Again</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user