Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c889c0b093 | |||
| 6b95b8d1ce | |||
| c60debfbba | |||
| cee984e574 | |||
| bf28e501a9 | |||
| 441b21ec35 | |||
| 5f8acf0d7d |
+1
-1
@@ -38,7 +38,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"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",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
|
||||
+10
-5
@@ -1,28 +1,33 @@
|
||||
import {Suspense, lazy} from 'react'
|
||||
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 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() {
|
||||
const { pathname } = useLocation();
|
||||
return (
|
||||
<Default>
|
||||
<SocketIOContextProvider>
|
||||
{/* <SocketIOContextProvider> */}
|
||||
<>
|
||||
{pathname.startsWith("/@") ? (
|
||||
<Navigate to="/app" replace={true} />
|
||||
) : (
|
||||
<Routers />
|
||||
<Suspense fallback={<LoadingSpinner size="32" color="sky-blue" height="h-screen" />}>
|
||||
<Routers />
|
||||
</Suspense>
|
||||
)}
|
||||
<Toaster />
|
||||
</>
|
||||
</SocketIOContextProvider>
|
||||
{/* </SocketIOContextProvider> */}
|
||||
</Default>
|
||||
);
|
||||
}
|
||||
|
||||
+88
-85
@@ -4,6 +4,7 @@ import { lazy } from "react";
|
||||
import LoginLandingPage from './views/LoginLandingPage'
|
||||
import LoginPage from "./views/LoginPage";
|
||||
import HomePages from "./views/HomePages";
|
||||
import SocketConnection from "./middleware/SocketConnection";
|
||||
|
||||
|
||||
const FourZeroFour = lazy(() => import("./components/FourZeroFour"));
|
||||
@@ -79,7 +80,7 @@ export default function Routers() {
|
||||
<ScrollToTop>
|
||||
<Routes>
|
||||
{/* guest routes */}
|
||||
{Number(process.env.REACT_APP_NEW_LOGIN_LAYOUT) === 1 ? (
|
||||
{process.env.REACT_APP_NEW_LOGIN_LAYOUT == 1 ? (
|
||||
<>
|
||||
<Route exact path="/login" element={<LoginLandingPage />} />
|
||||
<Route exact path="/login/:type" element={<LoginPageTwo />} />
|
||||
@@ -129,94 +130,96 @@ export default function Routers() {
|
||||
<Route exact path="/app" element={<AppDownloadPage />} />
|
||||
|
||||
{/* private route */}
|
||||
<Route element={<AuthRoute />}>
|
||||
<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="/tracking" element={<TrackingPage />} />
|
||||
<Route exact path="/calendar" element={<CalendarPage />} />
|
||||
<Route exact path="/resources" element={<ResourcePage />} />
|
||||
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
||||
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
||||
<Route exact path="/my-coupon" element={<MyCouponPage />} />
|
||||
<Route exact path="/notification" element={<Notification />} />
|
||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
||||
<Route exact path="/market" element={<MarketPlacePage />} />
|
||||
<Route exact path="/familymarket" element={<FamilyMarketPage />} />
|
||||
<Route exact path="/suggested" element={<ParentWaitingPage />} />
|
||||
<Route exact path="/parentwaiting" element={<ParentWaitingPage />} />
|
||||
<Route exact path="/pending" element={<FamilyPendingOfferPage />} />
|
||||
<Route exact path="/fam-blog" element={<FamBlogPage />} />
|
||||
<Route exact path="/ai-question" element={<FamAIQuestionPage />} />
|
||||
<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 element={<SocketConnection />}>
|
||||
<Route element={<AuthRoute />}>
|
||||
<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="/tracking" element={<TrackingPage />} />
|
||||
<Route exact path="/calendar" element={<CalendarPage />} />
|
||||
<Route exact path="/resources" element={<ResourcePage />} />
|
||||
<Route exact path="/my-wallet/*" element={<MyWalletPage />} />
|
||||
<Route exact path="/family-wallet" element={<FamilyWalletPage />} />
|
||||
<Route exact path="/my-coupon" element={<MyCouponPage />} />
|
||||
<Route exact path="/notification" element={<Notification />} />
|
||||
<Route exact path="/market-place" element={<MarketPlacePage />} />
|
||||
<Route exact path="/market" element={<MarketPlacePage />} />
|
||||
<Route exact path="/familymarket" element={<FamilyMarketPage />} />
|
||||
<Route exact path="/suggested" element={<ParentWaitingPage />} />
|
||||
<Route exact path="/parentwaiting" element={<ParentWaitingPage />} />
|
||||
<Route exact path="/pending" element={<FamilyPendingOfferPage />} />
|
||||
<Route exact path="/fam-blog" element={<FamBlogPage />} />
|
||||
<Route exact path="/ai-question" element={<FamAIQuestionPage />} />
|
||||
<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="/notification" element={<Notification />} />
|
||||
<Route exact path="/mytask" element={<MyTaskPage />} />
|
||||
<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-pastdue-jobs"
|
||||
element={<MyPastDueJobsPage />}
|
||||
/>
|
||||
<Route exact path="/my-offers" element={<MyOffersPage />} />
|
||||
<Route exact path="/pend-interest" element={<MyWaitingJobsPage />} />
|
||||
<Route
|
||||
exact
|
||||
path="/my-review-jobs"
|
||||
element={<MyReviewDueJobsPage />}
|
||||
/>
|
||||
<Route exact path="/pastdue" element={<MyPastDueTasksPage />} />
|
||||
<Route exact path="/notification" element={<Notification />} />
|
||||
<Route exact path="/mytask" element={<MyTaskPage />} />
|
||||
<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-pastdue-jobs"
|
||||
element={<MyPastDueJobsPage />}
|
||||
/>
|
||||
<Route exact path="/my-offers" element={<MyOffersPage />} />
|
||||
<Route exact path="/pend-interest" element={<MyWaitingJobsPage />} />
|
||||
<Route
|
||||
exact
|
||||
path="/my-review-jobs"
|
||||
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 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 exact path="/manage-family" element={<FamilyManagePage />} />
|
||||
<Route exact path="/start-job" element={<StartJob />} />
|
||||
<Route exact path="/yourpage" element={<YourPages />} />
|
||||
<Route
|
||||
exact
|
||||
path="/manage-active-job"
|
||||
element={<ManageActiveJobs />}
|
||||
/>
|
||||
<Route exact path="/blog-page" element={<BlogPage />} />
|
||||
<Route
|
||||
exact
|
||||
path="/offer-interest"
|
||||
element={<OffersInterestPage />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/manage-offer"
|
||||
element={<ManageInterestOfferPage />}
|
||||
/>
|
||||
<Route exact path="/manage-family" element={<FamilyManagePage />} />
|
||||
<Route exact path="/start-job" element={<StartJob />} />
|
||||
<Route exact path="/yourpage" element={<YourPages />} />
|
||||
<Route
|
||||
exact
|
||||
path="/manage-active-job"
|
||||
element={<ManageActiveJobs />}
|
||||
/>
|
||||
<Route exact path="/blog-page" element={<BlogPage />} />
|
||||
<Route
|
||||
exact
|
||||
path="/offer-interest"
|
||||
element={<OffersInterestPage />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/manage-offer"
|
||||
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="/learnmore" element={<LearnMorePage />} />
|
||||
{/*<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
|
||||
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="/learnmore" element={<LearnMorePage />} />
|
||||
{/*<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 />} />
|
||||
</Routes>
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
useDispatch,
|
||||
useSelector,
|
||||
usersService,
|
||||
initialValues as IV,
|
||||
// initialValues as IV,
|
||||
initialReqState,
|
||||
useState,
|
||||
tableReload,
|
||||
@@ -75,7 +75,7 @@ function AddJob({ popUpHandler, categories }) {
|
||||
// For form initial values
|
||||
const initialValues = {
|
||||
// initial values for formik
|
||||
country: walletDetails.data.length == 1 ? walletDetails.data[0].country : '',
|
||||
country: walletDetails.data.length === 1 ? walletDetails.data[0].country : '',
|
||||
price: "",
|
||||
title: "",
|
||||
description: "",
|
||||
@@ -117,7 +117,7 @@ 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`}
|
||||
onChange={props.handleChange}
|
||||
onBlur={props.handleBlur}
|
||||
disabled={walletDetails.data.length == 1}
|
||||
disabled={walletDetails.data.length === 1}
|
||||
>
|
||||
{walletDetails?.loading ? (
|
||||
<option className="text-slate-500 text-lg" value="">
|
||||
@@ -138,7 +138,7 @@ function AddJob({ popUpHandler, categories }) {
|
||||
</option>
|
||||
))}
|
||||
</>
|
||||
) : walletDetails.data.length == 1 ?
|
||||
) : walletDetails.data.length === 1 ?
|
||||
<>
|
||||
{walletDetails.data?.map((item, index) => (
|
||||
<option
|
||||
@@ -367,7 +367,7 @@ function AddJob({ popUpHandler, categories }) {
|
||||
{/* ERROR DISPLAY AND SUBMIT BUTTON */}
|
||||
<div className="content-footer w-full">
|
||||
{/* error or success display */}
|
||||
{requestStatus.message != "" &&
|
||||
{requestStatus.message !== "" &&
|
||||
(!requestStatus.status ? (
|
||||
<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]`}
|
||||
|
||||
@@ -6,7 +6,7 @@ import WrenchBoard from "../../assets/images/wrenchboard-logo-text.png";
|
||||
import DarkModeContext from "../Contexts/DarkModeContext";
|
||||
|
||||
export default function LoginLayout({ 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 bgImgCom = localImgLoad("images/wrench-home-back-common.jpg");
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function LoginLayout({ slogan, children }) {
|
||||
<div
|
||||
className={`relative min-h-screen overflow-y-auto bg-cover bg-center flex flex-col items-center`}
|
||||
style={{
|
||||
backgroundImage: `url(${countryMode == "NG" ? bgImgNig : bgImgCom})`,
|
||||
backgroundImage: `url(${countryMode === "NG" ? bgImgNig : bgImgCom})`,
|
||||
}}
|
||||
>
|
||||
<div className="my-5">
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import authProfilePic from "../../../assets/images/auth-profile-picture.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 ActivitiesTab from "./ActivitiesTab";
|
||||
import CollectionTab from "./CollectionTab";
|
||||
import CreatedTab from "./CreatedTab";
|
||||
import HiddenProductsTab from "./HiddenProductsTab";
|
||||
import OnSaleTab from "./OnSaleTab";
|
||||
import OwnTab from "./OwnTab";
|
||||
// import collections from "../../../data/collectionplan_data.json";
|
||||
// import marketPlace from "../../../data/marketplace_data.json";
|
||||
// import products from "../../../data/product_data.json";
|
||||
// import CollectionTab from "./CollectionTab";
|
||||
// import CreatedTab from "./CreatedTab";
|
||||
// import HiddenProductsTab from "./HiddenProductsTab";
|
||||
// import OnSaleTab from "./OnSaleTab";
|
||||
// import OwnTab from "./OwnTab";
|
||||
|
||||
export default function AuthProfile() {
|
||||
const onSaleProducts = marketPlace.data;
|
||||
const CreatedSell = marketPlace.data;
|
||||
const CreatedBits = products.datas;
|
||||
// const onSaleProducts = marketPlace.data;
|
||||
// const CreatedSell = marketPlace.data;
|
||||
// const CreatedBits = products.datas;
|
||||
// const mainProducts = products.datas;
|
||||
const ownProducts = products.datas;
|
||||
const collectionProducts = collections.data;
|
||||
// const ownProducts = products.datas;
|
||||
// const collectionProducts = collections.data;
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
id: 1,
|
||||
name: "onsale",
|
||||
content: "On Sale",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "owned",
|
||||
content: "Owned",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "created",
|
||||
content: "Created",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "hidden",
|
||||
content: "Hidden",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: "collection",
|
||||
content: "Collection",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
name: "activity",
|
||||
content: "Activity",
|
||||
},
|
||||
];
|
||||
// const tabs = [
|
||||
// {
|
||||
// id: 1,
|
||||
// name: "onsale",
|
||||
// content: "On Sale",
|
||||
// },
|
||||
// {
|
||||
// id: 2,
|
||||
// name: "owned",
|
||||
// content: "Owned",
|
||||
// },
|
||||
// {
|
||||
// id: 3,
|
||||
// name: "created",
|
||||
// content: "Created",
|
||||
// },
|
||||
// {
|
||||
// id: 4,
|
||||
// name: "hidden",
|
||||
// content: "Hidden",
|
||||
// },
|
||||
// {
|
||||
// id: 5,
|
||||
// name: "collection",
|
||||
// content: "Collection",
|
||||
// },
|
||||
// {
|
||||
// id: 6,
|
||||
// name: "activity",
|
||||
// content: "Activity",
|
||||
// },
|
||||
// ];
|
||||
|
||||
const [tab, setTab] = useState(tabs[0].name);
|
||||
const tabHandler = (value) => {
|
||||
setTab(value);
|
||||
};
|
||||
// const [tab, setTab] = useState(tabs[0].name);
|
||||
// const tabHandler = (value) => {
|
||||
// setTab(value);
|
||||
// };
|
||||
return (
|
||||
<>
|
||||
<Layout>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import usersService from '../../../services/UsersService';
|
||||
import {updateUserDetails} from "../../../store/UserDetails";
|
||||
import { useDispatch } from "react-redux";
|
||||
// import usersService from '../../../services/UsersService';
|
||||
// import {updateUserDetails} from "../../../store/UserDetails";
|
||||
// import { useDispatch } from "react-redux";
|
||||
import AuthLayout from "../AuthLayout";
|
||||
|
||||
function AppleRedirect() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const userApi = new usersService();
|
||||
const dispatch = useDispatch()
|
||||
// const userApi = new usersService();
|
||||
// const dispatch = useDispatch()
|
||||
|
||||
const queryParams = new URLSearchParams(location?.search);
|
||||
const codeResponse = queryParams.get("code");
|
||||
@@ -36,11 +36,11 @@ function AppleRedirect() {
|
||||
redirect_uri=https%3A//oauth2.example.com/code&
|
||||
grant_type=authorization_code
|
||||
*/
|
||||
var reqData = {
|
||||
auth_type: "APPLE",
|
||||
code: codeResponse,
|
||||
redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||
};
|
||||
// var reqData = {
|
||||
// auth_type: "APPLE",
|
||||
// code: codeResponse,
|
||||
// redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL,
|
||||
// };
|
||||
// userApi
|
||||
// .authStart(reqData)
|
||||
// .then((res) => {
|
||||
@@ -58,7 +58,7 @@ function AppleRedirect() {
|
||||
// navigate('/login', {state: {error: true}})
|
||||
// console.log(error);
|
||||
// });
|
||||
},[])
|
||||
},[codeResponse, navigate])
|
||||
return (
|
||||
<AuthLayout>
|
||||
<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 { useLocation, useNavigate } from 'react-router-dom';
|
||||
import usersService from '../../../services/UsersService';
|
||||
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout";
|
||||
function FbookRedirect() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const userApi = new usersService();
|
||||
const userApi = useMemo(()=> new usersService(),[]);
|
||||
const dispatch = useDispatch()
|
||||
|
||||
const queryParams = new URLSearchParams(location?.search);
|
||||
@@ -52,7 +52,7 @@ function FbookRedirect() {
|
||||
userApi
|
||||
.authStart(reqData)
|
||||
.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("uid", `${res.data.uid}`);
|
||||
localStorage.setItem("session_token", `${res.data.session}`);
|
||||
@@ -66,7 +66,7 @@ function FbookRedirect() {
|
||||
navigate('/login', {state: {error: true}})
|
||||
console.log(error);
|
||||
});
|
||||
},[])
|
||||
},[codeResponse, userApi, dispatch, navigate])
|
||||
return (
|
||||
<AuthLayout>
|
||||
<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 { useLocation, useNavigate } from "react-router-dom";
|
||||
import usersService from "../../../services/UsersService";
|
||||
@@ -8,7 +8,7 @@ import AuthLayout from "../AuthLayout";
|
||||
function Redirect() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const userApi = new usersService();
|
||||
const userApi = useMemo(()=> new usersService(),[]);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const queryParams = new URLSearchParams(location?.search);
|
||||
@@ -40,7 +40,7 @@ function Redirect() {
|
||||
.authStart(reqData)
|
||||
.then((res) => {
|
||||
if (
|
||||
res.status == 200 &&
|
||||
res.status === 200 &&
|
||||
res.data.internal_return >= 0 &&
|
||||
res.data.member_id &&
|
||||
res.data.uid &&
|
||||
@@ -59,7 +59,7 @@ function Redirect() {
|
||||
navigate("/login", { state: { error: true } });
|
||||
console.log(error);
|
||||
});
|
||||
}, []);
|
||||
}, [codeResponse, userApi, dispatch, navigate]);
|
||||
return (
|
||||
<AuthLayout>
|
||||
<div className="min-h-[70vh]">Redirecting ... </div>
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
|
||||
}
|
||||
|
||||
const resetHandler = async () => {
|
||||
if (email == "") {
|
||||
if (email === "") {
|
||||
setMsgError("An email is required");
|
||||
return setTimeout(() => {
|
||||
setMsgError(null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
// import WrenchBoard from "../../../assets/images/wrenchboard-logo-text.png";
|
||||
import usersService from "../../../services/UsersService";
|
||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||
import AuthLayout from "../AuthLayout2";
|
||||
@@ -38,7 +38,7 @@ export default function ForgotPassword() {
|
||||
}
|
||||
|
||||
const resetHandler = async () => {
|
||||
if (email == "") {
|
||||
if (email === "") {
|
||||
setMsgError("An email is required");
|
||||
return setTimeout(() => {
|
||||
setMsgError(null);
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function MarketPlace({ commonHeadData }) {
|
||||
const marketData = jobLists?.result_list;
|
||||
const categories = jobLists?.categories;
|
||||
const image_server = jobLists?.session_image_server;
|
||||
console.log('Lenth', marketData?.length )
|
||||
// console.log('Lenth', marketData?.length )
|
||||
|
||||
useEffect(()=>{
|
||||
if(!jobLists.loading && (marketData?.length < 1 || !marketData)){
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
import SocketIOContextProvider from '../components/Contexts/SocketIOContext'
|
||||
import { Navigate, Outlet, useNavigate } from "react-router-dom";
|
||||
|
||||
export default function SocketConnection() {
|
||||
return (
|
||||
<SocketIOContextProvider>
|
||||
<Outlet />
|
||||
</SocketIOContextProvider>
|
||||
)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useContext, useState, useEffect } from "react";
|
||||
import React, { useMemo, useState, useEffect } from "react";
|
||||
// import BlogItem from "../components/Blogs";
|
||||
import { useSelector } from "react-redux";
|
||||
import OffersInterest from "../components/OffersInterest";
|
||||
@@ -15,7 +15,7 @@ export default function OffersInterestPage() {
|
||||
|
||||
let {joinRoom} = SocketValues() // function to join room for socket
|
||||
|
||||
const apiCall = new usersService()
|
||||
const apiCall = useMemo(()=> new usersService(),[])
|
||||
|
||||
let {commonHeadBanner} = useSelector(state => state.commonHeadBanner)
|
||||
|
||||
@@ -28,11 +28,11 @@ export default function OffersInterestPage() {
|
||||
setOfferInterestList({loading: false, data: [], imgServer:''})
|
||||
console.log('Error: ', err)
|
||||
})
|
||||
},[offerInterestListReload])
|
||||
},[apiCall, offerInterestListReload])
|
||||
|
||||
useEffect(()=>{
|
||||
joinRoom(`INTEREST-${userDetails?.uid}`)
|
||||
},[])
|
||||
},[joinRoom, userDetails])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
+12
-12
@@ -1,22 +1,22 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useCallback, useMemo, useState, useEffect } from "react";
|
||||
import Resources from "../components/Resources";
|
||||
import usersService from "../services/UsersService";
|
||||
import { useLocation } from "react-router-dom";
|
||||
export default function ResourcePage() {
|
||||
const {state, pathname} = useLocation() // CHECKS IF THERE IS AN ACTIVE TAB WITH LINK BACK TO RESOURCES
|
||||
const {state} = useLocation() // CHECKS IF THERE IS AN ACTIVE TAB WITH LINK BACK TO RESOURCES
|
||||
const [MyResourceData, setMyResourceData] = useState([]);
|
||||
const api = new usersService();
|
||||
const getMyResourceData = async () => {
|
||||
try {
|
||||
const res = await api.getResourceList();
|
||||
setMyResourceData(res.data);
|
||||
} catch (error) {
|
||||
throw new Error("Error getting mode");
|
||||
}
|
||||
};
|
||||
const api = useMemo(()=> new usersService(),[]);
|
||||
const getMyResourceData = useCallback( async () => {
|
||||
try {
|
||||
const res = await api.getResourceList();
|
||||
setMyResourceData(res.data);
|
||||
} catch (error) {
|
||||
throw new Error("Error getting mode");
|
||||
}
|
||||
},[api])
|
||||
useEffect(() => {
|
||||
getMyResourceData();
|
||||
}, []);
|
||||
}, [getMyResourceData]);
|
||||
|
||||
return <Resources MyResourceData={MyResourceData} activeTab={state ? state.tab : ''} />;
|
||||
}
|
||||
Reference in New Issue
Block a user