Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 exact path="/outmessage" element={<VerifyYouPagesTwo />} />
|
||||
<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 />} />
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -67,6 +67,7 @@ export default function SocketIOContextProvider({children}) {
|
||||
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
|
||||
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
|
||||
dispatch(tableReload({type:'PARENTFAMILYTASKLIST'})) // dispatches to update parent family task list on parent side
|
||||
|
||||
@@ -31,7 +31,10 @@ function ReferralTable({ history }) {
|
||||
currentReferral.map((item, index) => (
|
||||
<tr key={index} className="text-slate-500">
|
||||
<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 className="p-3">{item.email}</td>
|
||||
<td className="p-3">{item.status}</td>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { toast } from "react-toastify";
|
||||
// import { toast } from "react-toastify";
|
||||
import usersService from "../../services/UsersService";
|
||||
import InputCom from "../Helpers/Inputs/InputCom";
|
||||
import LoadingSpinner from "../Spinners/LoadingSpinner";
|
||||
@@ -74,7 +74,7 @@ function ReferralDisplay() {
|
||||
};
|
||||
|
||||
//FUNCTION TO SEND REFERRAL MESSAGE
|
||||
const sendReferralMsg = (postData) => {
|
||||
const sendReferralMsg = (postData, helpers) => {
|
||||
apiCall
|
||||
.sendReferralMsg(postData)
|
||||
.then((res) => {
|
||||
@@ -84,11 +84,17 @@ function ReferralDisplay() {
|
||||
loading: false,
|
||||
status: false,
|
||||
});
|
||||
return;
|
||||
setTimeout(()=>{
|
||||
setError({ message: '', loading: false, status: false });
|
||||
},3000)
|
||||
} else {
|
||||
toast.success(res.data.status | "Message Sent!");
|
||||
setError({ message: "", loading: false, status: true });
|
||||
// toast.success(res.data.status | "Message Sent!");
|
||||
setError({ message: res.data.status, loading: false, status: true });
|
||||
helpers.resetForm() // resets the form data
|
||||
setRefHistoryReload((prev) => !prev);
|
||||
setTimeout(()=>{
|
||||
setError({ message: '', loading: false, status: true });
|
||||
},3000)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -97,13 +103,16 @@ function ReferralDisplay() {
|
||||
loading: false,
|
||||
status: false,
|
||||
});
|
||||
setTimeout(()=>{
|
||||
setError({ message: '', loading: false, status: false });
|
||||
},3000)
|
||||
});
|
||||
};
|
||||
|
||||
//FUNCTION TO HANDLE SUBMIT
|
||||
const handleSubmit = (values, helpers) => {
|
||||
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");
|
||||
@@ -228,7 +237,7 @@ function ReferralDisplay() {
|
||||
|
||||
<hr />
|
||||
{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">
|
||||
{error.loading ? (
|
||||
@@ -237,6 +246,7 @@ function ReferralDisplay() {
|
||||
<button
|
||||
type="submit"
|
||||
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
|
||||
</button>
|
||||
@@ -251,9 +261,12 @@ function ReferralDisplay() {
|
||||
{selectedTab == 'Referral List' &&
|
||||
<>
|
||||
<div className="w-full p-4">
|
||||
<h2 className="mb-2 text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||
Referral List
|
||||
</h2>
|
||||
<div className='mb-2 flex flex-wrap gap-4 items-center'>
|
||||
<h2 className="text-slate-900 dark:text-white text-xl lg:text-2xl font-medium">
|
||||
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 ? (
|
||||
<LoadingSpinner size="22" color="sky-blue" />
|
||||
) : (
|
||||
|
||||
@@ -20,11 +20,12 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
|
||||
let {joinRoom} = SocketValues() // destructures 'SEND MESSAGE' and 'JOIN ROOM' FUNCTIONS FROM SOCKET
|
||||
|
||||
const [nocache, setNoCache] = useState(false) // holds cache/nocache value
|
||||
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
const dispatch = useDispatch();
|
||||
const [lastActivityTime, setLastActivityTime] = useState(Date.now());
|
||||
const [isLogin, setIsLogin] = useState({ loading: true, status: false });
|
||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { jobListTable, marketTableList, walletTable, familyBannersListTable, homeBanners } = useSelector(
|
||||
@@ -46,19 +47,12 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
};
|
||||
|
||||
const checkInactivity = setInterval(() => {
|
||||
let { account_type } = loadProfileDetails;
|
||||
if (account_type === "FAMILY") {
|
||||
if (
|
||||
Date.now() - lastActivityTime >
|
||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY
|
||||
) {
|
||||
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY)) {
|
||||
expireSession();
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
Date.now() - lastActivityTime >
|
||||
process.env.REACT_APP_SESSION_EXPIRE_MINUTES
|
||||
) {
|
||||
if (Date.now() - Number(lastActivityTime) > Number(process.env.REACT_APP_SESSION_EXPIRE_MINUTES)) {
|
||||
expireSession();
|
||||
}
|
||||
}
|
||||
@@ -68,7 +62,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
return () => {
|
||||
clearInterval(checkInactivity);
|
||||
};
|
||||
}, [lastActivityTime, navigate]);
|
||||
}, [lastActivityTime, navigate, isLogin.status]);
|
||||
|
||||
// Reset last activity time on user input
|
||||
const resetTime = useCallback(() => {
|
||||
@@ -97,9 +91,9 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
setIsLogin({ loading: false, status: false });
|
||||
return;
|
||||
}
|
||||
setLoadProfileDetails(res.data);
|
||||
dispatch(updateUserDetails({ ...res.data }));
|
||||
setIsLogin({ loading: false, status: true });
|
||||
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||
})
|
||||
.catch((error) => {
|
||||
setIsLogin({ loading: false, status: false });
|
||||
@@ -108,6 +102,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
loadProfile();
|
||||
}else{
|
||||
setIsLogin({ loading: false, status: true });
|
||||
setNoCache(true) // Sets no cache to true, so as to trigger nocache whenever used in api call
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -141,8 +136,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
dispatch(updateNotifications({ loading: false, data: null }));
|
||||
return;
|
||||
}
|
||||
setLoadProfileDetails(res.data);
|
||||
|
||||
const _raw = res.data?.result_list;
|
||||
|
||||
//Sort the notifications in ascending order based on the API time
|
||||
@@ -280,8 +273,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
}
|
||||
const getFamilyBanners = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||
// setFamilyBannersList({loading:true, result:[]});
|
||||
dispatch(familyBannersList({loading:true}))
|
||||
const noCache = (isLogin.status && nocache )? 1 : 0
|
||||
const reqData = {nocache: noCache}
|
||||
try {
|
||||
const res = await apiCall.getFamilyBannersList();
|
||||
const res = await apiCall.getFamilyBannersList(reqData);
|
||||
dispatch(familyBannersList({...res?.data, loading:false}))
|
||||
} catch (error) {
|
||||
dispatch(familyBannersList({loading:false}))
|
||||
|
||||
@@ -618,8 +618,8 @@ class usersService {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
sessionid: localStorage.getItem("session_token"),
|
||||
offset: 1,
|
||||
limit: 100,
|
||||
offset: 0,
|
||||
limit: 140,
|
||||
action: apiConst.WRENCHBOARD_ACCOUNT_REFFERHX,
|
||||
};
|
||||
return this.postAuxEnd("/refferhx", postData);
|
||||
@@ -1396,7 +1396,7 @@ class usersService {
|
||||
}
|
||||
|
||||
// API FUNCTION TO FAMILY BANNERS
|
||||
getFamilyBannersList() {
|
||||
getFamilyBannersList(reqData) {
|
||||
var postData = {
|
||||
uid: localStorage.getItem("uid"),
|
||||
member_id: localStorage.getItem("member_id"),
|
||||
@@ -1404,6 +1404,7 @@ class usersService {
|
||||
action: apiConst.WRENCHBOARD_ACCOUNT_FAMILY_BANNERS,
|
||||
limit: 20,
|
||||
offset: 1,
|
||||
...reqData
|
||||
};
|
||||
return this.postAuxEnd("/familybanners", postData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user