Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e7a46c25c1 | |||
| 8e9ae8187f | |||
| b25a9c154b | |||
| 66bfe4be82 | |||
| 02773ed1da | |||
| e6c02468de | |||
| 58a75a1c89 | |||
| 8a5b784381 | |||
| 883a98951a | |||
| 7aaae11993 | |||
| ccebe37c34 |
@@ -23,7 +23,7 @@ REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
|||||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=1800000
|
||||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||||
|
|
||||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ REACT_APP_PRIMARY_SOCKET="https://socket-dev.wrenchboard.com"
|
|||||||
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
#"https://devapi.mermsemr.com/en/desktop/api/v2/myfituser"
|
||||||
|
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES=600000
|
||||||
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=600000
|
REACT_APP_SESSION_EXPIRE_MINUTES_FAMILY=1800000
|
||||||
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
REACT_APP_SESSION_EXPIRE_CHECKER=60000
|
||||||
|
|
||||||
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
REACT_APP_LOGIN_ERROR_TIMEOUT=7000
|
||||||
|
|||||||
+1
-1
@@ -23,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
|
||||||
|
|||||||
+2
-27
@@ -3,10 +3,9 @@ import { lazy } from "react";
|
|||||||
|
|
||||||
import LoginLandingPage from './views/LoginLandingPage'
|
import LoginLandingPage from './views/LoginLandingPage'
|
||||||
import LoginPage from "./views/LoginPage";
|
import LoginPage from "./views/LoginPage";
|
||||||
import HomePages from "./views/HomePages";
|
|
||||||
import SocketConnection from "./middleware/SocketConnection";
|
import SocketConnection from "./middleware/SocketConnection";
|
||||||
|
|
||||||
|
const HomePages = lazy(() => import("./views/HomePages"));
|
||||||
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
||||||
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
const ScrollToTop = lazy(() => import("./components/Helpers/ScrollToTop"));
|
||||||
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
const StartJob = lazy(() => import("./components/MyJobs/StartJob"));
|
||||||
@@ -17,8 +16,6 @@ const AppleRedirectPage = lazy(() => import("./views/AppleRedirectPage"));
|
|||||||
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
const AuthProfilePage = lazy(() => import("./views/AuthProfilePage"));
|
||||||
const AuthRedirect = lazy(() => import("./views/AuthRedirect"));
|
const AuthRedirect = lazy(() => import("./views/AuthRedirect"));
|
||||||
const BlogPage = lazy(() => import("./views/BlogPage"));
|
const BlogPage = lazy(() => import("./views/BlogPage"));
|
||||||
const CalendarPage = lazy(() => import("./views/CalendarPage"));
|
|
||||||
const CollectionItemPage = lazy(() => import("./views/CollectionItemPage"));
|
|
||||||
const FacebookRedirect = lazy(() => import("./views/FacebookRedirect"));
|
const FacebookRedirect = lazy(() => import("./views/FacebookRedirect"));
|
||||||
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
const FamilyManagePage = lazy(() => import("./views/FamilyManagePage"));
|
||||||
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
const FamilyMarketPage = lazy(() => import("./views/FamilyMarketPage"));
|
||||||
@@ -45,8 +42,6 @@ const OffersInterestPage = lazy(()=> import("./views/OffersInterestPage"));
|
|||||||
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
const ReferralPage = lazy(()=> import("./views/ReferralPage"));
|
||||||
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
const RemindersPage = lazy(()=> import("./views/RemindersPage"));
|
||||||
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
const ResourcePage = lazy(()=> import("./views/ResourcePage"));
|
||||||
const SavedPage = lazy(()=> import("./views/SavedPage"));
|
|
||||||
const SellPage = lazy(()=> import("./views/SellPage"));
|
|
||||||
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
const SettingsPage = lazy(()=> import("./views/SettingsPage"));
|
||||||
const SignupPage = lazy(()=> import("./views/SignupPage"));
|
const SignupPage = lazy(()=> import("./views/SignupPage"));
|
||||||
const SignupPageTwo = lazy(()=> import("./views/SignupPageTwo"));
|
const SignupPageTwo = lazy(()=> import("./views/SignupPageTwo"));
|
||||||
@@ -80,7 +75,7 @@ export default function Routers() {
|
|||||||
<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={<LoginLandingPage />} />
|
<Route exact path="/login" element={<LoginLandingPage />} />
|
||||||
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
||||||
@@ -133,14 +128,8 @@ export default function Routers() {
|
|||||||
<Route element={<SocketConnection />}>
|
<Route element={<SocketConnection />}>
|
||||||
<Route element={<AuthRoute />}>
|
<Route element={<AuthRoute />}>
|
||||||
<Route exact path="/" element={<HomePages />} />
|
<Route exact path="/" element={<HomePages />} />
|
||||||
{/* <Route exact path="/active-bids" element={<AcitveBidsPage />} />
|
|
||||||
<Route exact path="/notification" element={<Notification />} />
|
|
||||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
|
||||||
<Route exact path="/shop-details" element={<ShopDetailsPage />} />
|
|
||||||
<Route exact path="/my-collection" element={<MyCollection />} />*/}
|
|
||||||
<Route exact path="/reminders" element={<RemindersPage />} />
|
<Route exact path="/reminders" element={<RemindersPage />} />
|
||||||
<Route exact path="/tracking" element={<TrackingPage />} />
|
<Route exact path="/tracking" element={<TrackingPage />} />
|
||||||
<Route exact path="/calendar" element={<CalendarPage />} />
|
|
||||||
<Route exact path="/resources" element={<ResourcePage />} />
|
<Route exact path="/resources" element={<ResourcePage />} />
|
||||||
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
||||||
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
||||||
@@ -163,7 +152,6 @@ export default function Routers() {
|
|||||||
<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
|
||||||
@@ -177,10 +165,6 @@ export default function Routers() {
|
|||||||
path="/my-review-jobs"
|
path="/my-review-jobs"
|
||||||
element={<MyReviewDueJobsPage />}
|
element={<MyReviewDueJobsPage />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <Route exact path='/acc-family' element={<FamilyAccPage />} />
|
|
||||||
<Route exact path="/acc-family/activities" element={<FamilyActivitiesPage />} />
|
|
||||||
<Route exact path="/acc-family/familysettings" element={<FamilySettingsPage />} /> */}
|
|
||||||
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
<Route path='/acc-family/*' element={<FamilyRoutesPage />} />
|
||||||
|
|
||||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||||
@@ -202,17 +186,8 @@ export default function Routers() {
|
|||||||
path="/manage-offer"
|
path="/manage-offer"
|
||||||
element={<ManageInterestOfferPage />}
|
element={<ManageInterestOfferPage />}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route
|
|
||||||
exact
|
|
||||||
path="/my-collection/collection-item"
|
|
||||||
element={<CollectionItemPage />}
|
|
||||||
/>
|
|
||||||
<Route exact path="/sell" element={<SellPage />} />
|
|
||||||
<Route exact path="/saved" element={<SavedPage />} />
|
|
||||||
<Route exact path="/history" element={<HistoryPage />} />
|
<Route exact path="/history" element={<HistoryPage />} />
|
||||||
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
<Route exact path="/learnmore" element={<LearnMorePage />} />
|
||||||
{/*<Route exact path="/upload-product" element={<UploadProductPage />} />*/}
|
|
||||||
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
<Route exact path="/my-uploads" element={<UploadProductPage />} />
|
||||||
<Route exact path="/profile" element={<AuthProfilePage />} />
|
<Route exact path="/profile" element={<AuthProfilePage />} />
|
||||||
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
<Route exact path="/user-profile" element={<UserProfilePage />} />
|
||||||
|
|||||||
@@ -2,49 +2,55 @@ import React, { useState, useEffect } from "react";
|
|||||||
import datas from "../../data/product_data.json";
|
import datas from "../../data/product_data.json";
|
||||||
import Layout from "../Partials/Layout";
|
import Layout from "../Partials/Layout";
|
||||||
import usersService from "../../services/UsersService";
|
import usersService from "../../services/UsersService";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import FamilyDash from "./FamilyDash";
|
import FamilyDash from "./FamilyDash";
|
||||||
import FullAccountDash from "./FullAccountDash";
|
import FullAccountDash from "./FullAccountDash";
|
||||||
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
|
import LoadingSpinner from '../../components/Spinners/LoadingSpinner'
|
||||||
|
import { tableReload } from '../../store/TableReloads';
|
||||||
|
|
||||||
export default function Home(props) {
|
export default function Home(props) {
|
||||||
// console.log("PROPS IN HOME->", props);
|
|
||||||
// const userApi = new usersService();
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
||||||
const { userDetails } = useSelector((state) => state?.userDetails);
|
const { userDetails } = useSelector((state) => state?.userDetails);
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
if(!commonHeadBanner.loading && (!commonHeadBanner?.data || Object.keys(commonHeadBanner?.data).length < 1)){
|
||||||
|
dispatch(tableReload({ type: "HOMEBANNERS" })); // reloads home banner in case it fails to load or encounters error while loading
|
||||||
|
}
|
||||||
|
},[])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
<>
|
||||||
<FamilyDash
|
{userDetails && userDetails?.account_type == "FAMILY" ? (
|
||||||
account={userDetails}
|
<FamilyDash
|
||||||
commonHeadData={props.bannerList}
|
account={userDetails}
|
||||||
// familyOffers={MyOffersList?.data}
|
commonHeadData={commonHeadBanner?.data?.result_list}
|
||||||
serverImg = {userDetails?.session_image_server}
|
serverImg = {userDetails?.session_image_server}
|
||||||
// MyActiveJobList={MyActiveJobList?.data}
|
/>
|
||||||
/>
|
) : userDetails && userDetails?.account_type == "FULL" ? (
|
||||||
) : userDetails && userDetails?.account_type == "FULL" ? (
|
<>
|
||||||
<>
|
{commonHeadBanner.loading ?
|
||||||
{Object.keys(commonHeadBanner).length < 1 ?
|
<LoadingSpinner height='h-48' size='16' />
|
||||||
<LoadingSpinner height='h-48' size='16' />
|
:
|
||||||
:
|
<FullAccountDash
|
||||||
<FullAccountDash
|
bannerList={commonHeadBanner?.data?.result_list}
|
||||||
bannerList={props.bannerList}
|
dashTypes={commonHeadBanner?.data?.home_dash_type}
|
||||||
dashTypes={props.dashTypes}
|
offersList={commonHeadBanner?.data?.offers_list}
|
||||||
// offersList={MyOffersList}
|
imageServer={commonHeadBanner?.data?.session_image_server}
|
||||||
// MyActiveJobList={MyActiveJobList}
|
/>
|
||||||
offersList={props.offersList}
|
|
||||||
imageServer={props.imageServer}
|
|
||||||
/>
|
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
You are not logged in or your account type is not supported.
|
You are not logged in or your account type is not supported.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</>
|
||||||
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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";
|
||||||
@@ -84,11 +84,16 @@ 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 });
|
||||||
setRefHistoryReload((prev) => !prev);
|
setRefHistoryReload((prev) => !prev);
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: true });
|
||||||
|
},3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -97,6 +102,9 @@ function ReferralDisplay() {
|
|||||||
loading: false,
|
loading: false,
|
||||||
status: false,
|
status: false,
|
||||||
});
|
});
|
||||||
|
setTimeout(()=>{
|
||||||
|
setError({ message: '', loading: false, status: false });
|
||||||
|
},3000)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -228,7 +236,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 +245,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>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
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 +45,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 +60,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,7 +89,6 @@ 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 });
|
||||||
})
|
})
|
||||||
@@ -116,16 +107,17 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
|||||||
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
dispatch(commonHeadBanner({loading:true, data:{}}));
|
||||||
apiCall
|
apiCall
|
||||||
.getHeroJBanners()
|
.getHeroJBanners()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.data?.internal_return < 0) {
|
if (res?.data?.internal_return < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(commonHeadBanner(res.data));
|
dispatch(commonHeadBanner({loading:false, data:res.data}));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// console.log("ERROR ", error);
|
dispatch(commonHeadBanner({loading:false, data:{}}));
|
||||||
});
|
});
|
||||||
}, [isLogin.status, homeBanners]);
|
}, [isLogin.status, homeBanners]);
|
||||||
|
|
||||||
@@ -140,8 +132,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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
commonHeadBanner: {}
|
commonHeadBanner: {loading:true, data:{}}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const commonHeadBannerSlice = createSlice({
|
export const commonHeadBannerSlice = createSlice({
|
||||||
|
|||||||
+1
-15
@@ -1,24 +1,10 @@
|
|||||||
import {useState, useEffect} from 'react'
|
|
||||||
import { useSelector } from "react-redux";
|
|
||||||
import Home from "../components/Home";
|
import Home from "../components/Home";
|
||||||
|
|
||||||
export default function HomePages() {
|
export default function HomePages() {
|
||||||
const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner);
|
|
||||||
const [bannerOptions, setBannerOptions] = useState({})
|
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
const bannerOptions = {
|
|
||||||
bannerList: commonHeadBanner?.result_list,
|
|
||||||
dashTypes: commonHeadBanner?.home_dash_type,
|
|
||||||
offersList: commonHeadBanner?.offers_list,
|
|
||||||
imageServer: commonHeadBanner?.session_image_server
|
|
||||||
};
|
|
||||||
setBannerOptions(bannerOptions)
|
|
||||||
},[commonHeadBanner])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Home {...bannerOptions} />
|
<Home />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user