Compare commits

..

6 Commits

Author SHA1 Message Date
victorAnumudu e7a46c25c1 refer-page-fixed 2024-11-28 17:46:14 +01:00
ameye 8e9ae8187f Merge branch 'home-page-bug' of WrenchBoard/Users-Wrench into master 2024-11-28 11:39:18 +00:00
CHIEFSOFT\ameye b25a9c154b refer list ofset 2024-11-28 06:01:59 -05:00
CHIEFSOFT\ameye 66bfe4be82 span to div 2024-11-28 05:54:53 -05:00
CHIEFSOFT\ameye e6c02468de format 2024-11-28 05:25:43 -05:00
CHIEFSOFT\ameye 8a5b784381 Refrormat refern list 2024-11-28 05:14:51 -05:00
4 changed files with 23 additions and 22 deletions
@@ -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>
+14 -5
View File
@@ -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";
@@ -84,11 +84,16 @@ 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 });
setRefHistoryReload((prev) => !prev);
setTimeout(()=>{
setError({ message: '', loading: false, status: true });
},3000)
}
})
.catch((error) => {
@@ -97,6 +102,9 @@ function ReferralDisplay() {
loading: false,
status: false,
});
setTimeout(()=>{
setError({ message: '', loading: false, status: false });
},3000)
});
};
@@ -228,7 +236,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 +245,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>
+3 -14
View File
@@ -24,7 +24,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
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 +45,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 +60,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,7 +89,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
setIsLogin({ loading: false, status: false });
return;
}
setLoadProfileDetails(res.data);
dispatch(updateUserDetails({ ...res.data }));
setIsLogin({ loading: false, status: true });
})
@@ -141,8 +132,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
+2 -2
View File
@@ -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);